Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Durga D
Fixed it. It allows duplicates when stmt reset(sqlite3_reset) missed after sqlite3_step(..) in transaction. Thank you. On Thu, Jan 12, 2012 at 4:27 PM, Simon Slavin wrote: > > On 12 Jan 2012, at 10:52am, Durga D wrote: > > > I have attached sample db. I tried to simulate with test applicatio

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Simon Slavin
On 12 Jan 2012, at 10:52am, Durga D wrote: > I have attached sample db. I tried to simulate with test application. > But, I could not. > >Please find the attached db, which has only one table. You can't attach things to messages to this list, because we don't want the list flooded with e

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Durga D
Simon, Thank you for your quick responses. I have attached sample db. I tried to simulate with test application. But, I could not. Please find the attached db, which has only one table. Based on schema and data, you can identify the duplicate issue. columne 2 and 3 are duplicated.

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Simon Slavin
On 12 Jan 2012, at 10:14am, Durga D wrote: > create table if not exists t0 ( > h integer primary key autoincrement, > t0info text, unique(t0info)); > > t0 table allows duplicate t0info column, when in transaction. > > how to avoid duplicates for t0info column. If your table was cre

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Durga D
Thank you. create table if not exists t0 ( h integer primary key autoincrement, t0info text, unique(t0info)); t0 table allows duplicate t0info column, when in transaction. how to avoid duplicates for t0info column. Thanks in advance. Durga. On Thu, Jan 12, 2012 at 3:37 PM, Simon

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-12 Thread Simon Slavin
On 12 Jan 2012, at 6:05am, Durga D wrote: >Insertion time, I am able to get the rowid from > sqlite3_last_insert_rowid(); > > It's working fine. > > Now, t0info record already exists, that time , I should not update > with latest rowid. I should fetch the corresponding h val

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-11 Thread Durga D
Corrected it. Thank you. insert into t1( hh, t1info) values ((select h from t0 where t0info = ?), ?) On Thu, Jan 12, 2012 at 11:35 AM, Durga D wrote: > Dear Igor, > > Insertion time, I am able to get the rowid from > sqlite3_last_insert_rowid(); > >It's working fine. > >

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-11 Thread Durga D
Dear Igor, Insertion time, I am able to get the rowid from sqlite3_last_insert_rowid(); It's working fine. Now, t0info record already exists, that time , I should not update with latest rowid. I should fetch the corresponding h value, update in t1 table. Here, fetching is t

Re: [sqlite] primary key autoincrement updation problemincaserefereced

2012-01-11 Thread Igor Tandetnik
Durga D wrote: > Dear Igor, > >If already toinfo record exists, that time how to get the h > (primary key) (instead of rowid)? An INTEGER PRIMARY KEY column is in fact an alias for rowid. They are one and the same. -- Igor Tandetnik ___ sqli