On 13 Jun 2012, at 6:24am, sivaram pothuru <pothuru.siva...@gmail.com> wrote:

> Hi,
> 
>      Greetings of the day!
> 
>         I have seen you

I don't know who 'you' is here, but you sent your message to a whole mailing 
list.  In future, please include your question in your message to this list.  
Don't make us go look something up on a web page.

In an earlier question you posted.

>       Create table T1 (id INTEGER PRIMARY KEY not null, puid UNIQUE
> INTEGER not null, format INTEGER not null);

If you insert a row into this table, and do not define a value for the 'id' 
column, SQLite will make up a unique value for it.  This is SQLite's method of 
generating unique numbers for you, and there's no need for you to do a similar 
job yourself using the puid column.  I agree with John Stanton's post.

If you're happy to let SQLite make up its values and don't need to do anything 
else with these values, just let SQLite do its job.  If you need to know what 
value SQLite made up for the row you just inserted you can use the SQL function 
'last_insert_rowid()' as documented here:

<http://www.sqlite.org/lang_corefunc.html>

or the sqlite3_last_insert_rowid() C function as documented here:

<http://www.sqlite.org/c3ref/last_insert_rowid.html>

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to