code that work for C++ in
this case.
Sorry for the question.
Thanks,
JP
- Original Message
From: John Stanton <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Monday, December 17, 2007 12:59:00 PM
Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETI
Joanne Pham wrote:
My application is used C++ to insert/select the data from this table. So if I
defined it as
create table mytable (
createDate REAL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (remoteWXId)
);
Then I can use sqlite3_bind_real to bind the column but what is the datatype
-users@sqlite.org
Sent: Monday, December 17, 2007 12:59:00 PM
Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME
or INTEGER.
Sqlite stores a date and time as a REAL so instead of trusting to
manifest typing to make it a REAL your code will be easier to follow if
you declar
instead of DATETIME.
Thanks,
Joanne
- Original Message
From: John Stanton <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Monday, December 17, 2007 10:00:11 AM
Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME
or INTEGER.
If you declared yo
Joanne Pham wrote:
I have two question regarding DATETIME column data type:
1 ) Should I store my COLUMN as INTEGER instead of DATETIME. Is it easier if this column type is INTEGER vs DATETIME then
do the conversion in the GUI code to convert from INTEGER TO DATETIME.
2) And if
Monday, December 17, 2007 10:00:11 AM
Subject: Re: [sqlite] create table with datatype = DATE. SHould use as DATETIME
or INTEGER.
If you declared your date and time (timestamp) column DATETIME it will
be floating point and will store date and time in 8 bytes. Use the FP
bind function. If yo
t: Thursday, December 13, 2007 2:48:26 PM
Subject: Re: [sqlite] create table with datatype = DATE
CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP)
On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote:
Hi All,
I create the table as :
create table test (name varchar(30)
t;[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, December 13, 2007 2:48:26 PM
Subject: Re: [sqlite] create table with datatype = DATE
CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP)
On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote:
> Hi All,
>
m: John Stanton <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, December 13, 2007 3:05:52 PM
Subject: Re: [sqlite] create table with datatype = DATE
The type DATE is a declared type, not an actual type and has no effect u
nless your code specifically picks it out as a declar
Joanne Pham wrote:
Hi All,
Should I create the column in DATETIME or the INTEGER to store the time.
DATETIME has the value of GMT time. So I store this value as INTEGER then I
need to convert datetime format but it will be use less space if I use the
INTEGER. Please give me an advice.
See
- Original Message
From: John Stanton <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, December 13, 2007 3:05:52 PM
Subject: Re: [sqlite] create table with datatype = DATE
The type DATE is a declared type, not an actual type and has no effect u
nless your code specifically picks
The type DATE is a declared type, not an actual type and has no effect u
nless your code specifically picks it out as a declared type.
To do what you want use a trigger on insert and update the date field
with datetime('now');
Joanne Pham wrote:
Hi All,
I create the table as :
create tab
Hi Joanne,
create table test (name varchar(30), createDate DATE default
DATETIME('NOW'));
but I got the error message. I want to have the default as now if it
is not specify.
create table Test (Name text, createDate Date default current_date);
Tom
-
CREATE TABLE test (.. createData DATETIME DEFAULT CURRENT_TIMESTAMP)
On 12/13/07, Joanne Pham <[EMAIL PROTECTED]> wrote:
> Hi All,
> I create the table as :
> create table test (name varchar(30), createDate DATE default
> DATETIME('NOW'));
> but I got the error message. I want to have the def
Hi All,
I create the table as :
create table test (name varchar(30), createDate DATE default
DATETIME('NOW'));
but I got the error message. I want to have the default as now if it is not
specify.
Thanks in advance,
Joanne
__
15 matches
Mail list logo