> When i do a insert is there a way to know row already exists!!
Not without querying.
But you could do something like this:
CREATE TABLE t1(a PRIMARY KEY, b, c);
insert into t1
select 7, 'foo', 'bar' where not exists (
select null from t1 where a=7);
which is similar to:
INSERT OR IGNORE INTO t1 values(7, 'one', 'two');
except that the first insert form does not require any indexes
to work, and you have more flexibility with the where clause.
If you wish to insert a row if it does not exist, or update the
row if it does exist you can use REPLACE INTO:
REPLACE INTO t1 values(7, 'what', 'ever');
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------