nope. that doesnt work either. i got no problem
outputing other recoard. but got problem with
strftime('%s', 'now')
--- Jeff Thompson <[EMAIL PROTECTED]> wrote:
> On Tue, 1 Feb 2005 06:51:49 -0800 (PST), teoh
> <[EMAIL PROTECTED]> wrote:
> >
> > sqlite3::reader reader=con.executereader("select
> create table each_transaction(datetime int);
> insert into each_transaction values( datetime('%s', 'now'));
Perhaps you should say
insert into each_transaction values( strftime('%s', 'now'));
?
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
e
> this is how I create table an
Did you try this?
create table each_transaction(datetime text);
insert into each_transaction(datetime) values(datetime('now'));
D:\temp\convention>sqlite3 test.db
SQLite version 3.0.8
Enter ".help" for instructions
sqlite> create table each_transaction(datetime text);
sqlite> insert into each_
On Tue, 1 Feb 2005 06:51:49 -0800 (PST), teoh <[EMAIL PROTECTED]> wrote:
>
> sqlite3::reader reader=con.executereader("select *
> from each_transaction;");
> while(reader.read())
> {cout << reader.getcolname(0) << ": " <<
> reader.getstring(0) << endl; }
>
> I get output like this:
>
> datetime:
nope. reader.getint32(0) will return 0
i tried changed datetime to "text" and did the query
by getsring(0) and i get same invalid output
output:
รก "
i still cant use strftime('%s', 'now') .
--- [EMAIL PROTECTED] wrote:
> teoh <[EMAIL PROTECTED]> writes:
>
> > create table ea
teoh <[EMAIL PROTECTED]> writes:
> create table each_transaction(datetime int);
>
> insert into each_transaction values( datetime('%s',
> 'now'));
>
> this is how I create table and insert the
> strftime('%s', 'now'). But when I did query with
> sql3_plus.
>
> sqlite3::reader reader=con.executere
what i trying to say is, i cant use strftime('%s',
'now') but also to use other function like
datetime('now') . This is because the output of select
will be invalid. if i use datetime('now') . the output
is 2005-02-01 15:44:23 . How does the "select"
statement should look like if i want it to show
Does this fix it?
insert into each_transaction(datetime) values(datetime('now'));
--- teoh <[EMAIL PROTECTED]> wrote:
>
> create table each_transaction(datetime int);
>
> insert into each_transaction values( datetime('%s',
> 'now'));
>
> this is how I create table and insert the
> strftime(
create table each_transaction(datetime int);
insert into each_transaction values( datetime('%s',
'now'));
this is how I create table and insert the
strftime('%s', 'now'). But when I did query with
sql3_plus.
sqlite3::reader reader=con.executereader("select *
from each_transaction;");
while(rea
9 matches
Mail list logo