Marcelo S Zanetti <mszane...@yahoo.com> wrote: > I > have an item to insert in the table which will be inserted only if this > item is not yet in that table otherwise I would like to return the > item's key. > > like that > > IF 1==SELECT COUNT(*) from table > WHERE item==new THEN SELECT itemID from tabel WHERE item==new ELSE > INSERT INTO table (item) VALUES (new) > > It does not work in this way ... could somebody tell me please what is the > correct sintax or whether this is possible at all.
You use SQLite API to execute the three SQL statements, and use whatever programming language your host application is written in to implement the surrounding logic. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users