You can put a Primary Key (unique index) on the table.
 Then when inserting a duplicate, an error will be generated.
 Then test for the error.  
 
 Or if you want the new row to overwrite the original use insert or replace 
 
 If you goal is to keep the existing use insert or ignore.
 
 see:
 
 http://www.sqlite.org/lang_conflict.html
 
 

RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Q was incomplete.
When i do a insert is there a way to know row already exists!!

regrads
ragha

******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!
 
*****************************************************************************************

----- Original Message -----
From: RaghavendraK 70574 
Date: Thursday, July 19, 2007 5:17 pm
Subject: [sqlite] Duplicate Row check

> Hi,
> 
> How can check if a row exists in the db or not without querying for 
> it?
> regards
> ragha
> 
> 
> ******************************************************************************************
> This email and its attachments contain confidential information 
> from HUAWEI, which is intended only for the person or entity whose 
> address is listed above. Any use of the information contained 
> herein in any way (including, but not limited to, total or partial 
> disclosure, reproduction, or dissemination) by persons other than 
> the intended recipient(s) is prohibited. If you receive this e-mail 
> in error, please notify the sender by phone or email immediately 
> and delete it!
> 
> *****************************************************************************************
> --------------------------------------------------------------------
> ---------
> To unsubscribe, send email to [EMAIL PROTECTED]
> --------------------------------------------------------------------
> ---------
> 
> 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------


Reply via email to