SQlite newbie question

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: SQlite newbie question

Post by bangkok » Mon May 30, 2011 4:13 pm

CliveC wrote: The only explanation I can think of is the WHERE statement?
... yes of course !

It doesn't make sense to put a condition on a record... that does not even exist (because it is not yet created).
;-)
Furthermore your syntax is wrong.
Check :
http://www.tutorialspoint.com/mysql/mys ... -query.htm

So your query should be :

put "INSERT INTO project_settings (project_name,working_title) VALUES ( ' " & tProjName & " ', ' " & tWorkingTitle & " ' ) " into tSql
revExecuteSql tCon, tSql

And within your table structure, you declare a column "project_id", and you give to it the "auto increment" default, with for instance an INT (integer) datatype.
And you finish, by giving this column the status of "primary key".

Therefore, each record you'll insert will get a unique identifier : project_id.

Post Reply