RE: [sqlite] Duplicate Row check

2007-07-19 Thread Michael Flum
If you can, define one of the data entries in your table (Schema
defination) as "unique" when you create the table. The engine will then
set an error condition (call the callback function) and this should
prevent you from entering duplicate data and hence duplicate rows.

Michael

-Original Message-
From: RaghavendraK 70574 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 8:00 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Duplicate Row check

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 <[EMAIL PROTECTED]>
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]

-


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



[sqlite] Ascii data in string treated as a num

2007-07-19 Thread Michael Flum
I have a short program that requires storing of Ascii strings that
happen to be numbers. It seem that when I retrieve the data it has been
interrupted as a numeric value and is returned altered. I.E. "0E00" is
returned as "0", "" is returned as "0",  "76E0" is returned as "76"

 

Thanks for any help in advance.

 

   SQL_Write( db, "CREATE TABLE P ( ENCODING INTEGER PRIMARY KEY UNIQUE,
ST STRING, EN STRING, SW STRING,DW STRING,BX STRING);" );

 

sprintf(sql_statment,"INSERT INTO P VALUES(
%d,\'%s\',\'%s\',\'%s\',\'%s\',\'%s\');", evalue, pt[0], pt[1], pt[2],
pt[3], pt[4]);

 

Example: INSERT INTO P VALUES(
21,'0E00','','7E00','1234','NOVALUE');

 

Returned:   21, '0','0','7','1234','NOVALUE'

 

Michael Flum

Software Engineer

Haas Automation, Inc.