Hi all,
I have a problem with SQLLite when I create a table.
If my sql cod is
CREATE TABLE mytable field....
It works
If I write
CREATE TABLE IF NOT EXISTS mytable fields...
Non viene creata la tabella anche se non esiste.
There is another way to check also if the table exists, or something wrong?
Thank's
CREATE TABLE PROBLEM
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: CREATE TABLE PROBLEM
SELECT name FROM sqlite_master
WHERE type='table'
ORDER BY name;
sqlite_master is a default (but usually hidden) table in all sqlite databases, apparently.
WHERE type='table'
ORDER BY name;
sqlite_master is a default (but usually hidden) table in all sqlite databases, apparently.
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: CREATE TABLE PROBLEM
Hi info26,
you can use the build-in function: revDatabaseTableNames(databaseID)
to get a list of ALL tables in a database and then check if your table name is in this list!
Best
Klaus
you can use the build-in function: revDatabaseTableNames(databaseID)
to get a list of ALL tables in a database and then check if your table name is in this list!
Best
Klaus
Re: CREATE TABLE PROBLEM
Even better solutionKlaus wrote:Hi info26,
you can use the build-in function: revDatabaseTableNames(databaseID)
to get a list of ALL tables in a database and then check if your table name is in this list!

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.