a**********s 发帖数: 8 | 1 i followed example but it doesn't accept, always say there is error parse near
TIMESTAMP, pls. help me and tell me what the problem is.
I did:
INSERT INTO items VALUES(......,CURRENT TIMESTAMP,...);
The attribute has been set to be TIMESTAMP when i created this table.
Why I can't insert CURRENT TIMESTAMP? |
s**********i 发帖数: 711 | 2 not sure which database you are using, but
try CURRENT_TIMESTAMP
【在 a**********s 的大作中提到】 : i followed example but it doesn't accept, always say there is error parse near : TIMESTAMP, pls. help me and tell me what the problem is. : I did: : INSERT INTO items VALUES(......,CURRENT TIMESTAMP,...); : The attribute has been set to be TIMESTAMP when i created this table. : Why I can't insert CURRENT TIMESTAMP?
|
n**m 发帖数: 255 | 3 It should be CURRENT TIMESTAMP if you use DB2. I just tried it on my Machine.
and works.
【在 s**********i 的大作中提到】 : not sure which database you are using, but : try CURRENT_TIMESTAMP
|
a**********s 发帖数: 8 | 4 It's PostgreSQL... it doesn't work...
Machine.
parse near |
s**********i 发帖数: 711 | 5 postgresql manual says:
The following functions are available to obtain the current date and/or time:
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_TIME ( precision )
CURRENT_TIMESTAMP ( precision )
The function now() is the traditional PostgreSQL equivalent to
CURRENT_TIMESTAMP.
【在 a**********s 的大作中提到】 : It's PostgreSQL... it doesn't work... : Machine. : parse near
|