Hi Igor, Thanks for the response. Basiclly there is no SQL logic in SQLite. I would like to check if the database version is xyz then I will have different action and if then database version is abc then I will have different action. So SQLite doesn't allow this luxury. Thanks, JP
----- Original Message ---- From: Igor Tandetnik <[EMAIL PROTECTED]> To: SQLite <sqlite-users@sqlite.org> Sent: Wednesday, December 12, 2007 4:14:08 PM Subject: [sqlite] Re: How to check if the table has some specific values Joanne Pham <joannekpham-/[EMAIL PROTECTED]> wrote: > I have been working on MSSQL server and SQLite is new to me. I > usually did the following in MSQL server to check of the specific row > is existed in the table and have different action depending on the > result of the check. For example: Create table versionTable > (dbVersion varchar(20) insert into versionTable values('6, 0, 0, 1'); > Now the table is created and it has one row(6, 0, 0, 1). > I usually do the following to check the content of the table > > If NOT EXISTS ( select 1 from versionTable where dbVersion = '6, 0, > 0, 1') insert into versionTable values('6, 0, 0, 2'); > ELSE > update versionTable set dbVersion = '6, 0, 0, 2'; > > I really don't know how to convert these syntax from MSSQL server to > SQLite. delete from versionTable; insert into versionTable values ('6, 0, 0, 2'); Specifically for maintaining a version number in the database file, see also PRAGMA user_version at http://sqlite.org/pragma.html Igor Tandetnik ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] ----------------------------------------------------------------------------- ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping