On 10/22/08, Hari <[EMAIL PROTECTED]> wrote:
> Hi All,
>  i want to know the particular that time and date when a row is inserted
>  in a table.
>  as i am using sqlite3_exec() function for sql query.
>  my sql statements are like:
>  sqlite3_exec(--, "create table my_table (key INTEGER,tag TEXT, timeEnter
>  DATE)", , , );
>  sqlite3_exec(--, "insert into my_table (key,TEXT) values
>  (1,'new'), , , ) ;
>  sqlite3_exec(--, "select datetime(timeEnter,'localtime') from my_table
>  where key=1", , , );
>  the third one is displaying null.
>  sqlite3_exec(--, "select * from my_table where key=1", , , )
>  it is displaying key and tag values but not giving time so how can i get
>  the time of
>  specifice row when it was inserted in table.
>  as if i use
>     select datetime ('now', 'localtime') from my_table    or
>     select strftime('%s','now','localtime') from my_table
>  it is giving current time. that i don't want. but i want the specific
>  row time when it was inserted.
>  am i missing something? as i want time at the time of insert, so how i
>  can get the that specific row time and date when this row was inserted.
>  suggest me any ideas..
>

Your table is

create table my_table (
  key INTEGER,
  tag TEXT,
  timeEnter DATE
)

Your insert statements are

insert into my_table (key,TEXT) values (1,'new')

Could you please tell looking from the above what will be inserted?

What you are missing is basic understanding of SQL, I mean, really
basic understanding of SQL. Any of the thousands of SQL tutorials on
the web will give you a good start.

After that, you will also be well advised to read the SQLite documents
on sqlite.org. That you are expecting the "specific row time when it
was inserted" from a column that has been declared as "timeEnter DATE"
implies that you haven't read any of the docs.


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to