由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - How to insert CURRENT TIMESTAMP into sql
相关主题
MS T-SQL 问题请教一个问题,big data入库
[转载] database for Linux?How to insert image to DB2 ?
where can I download SQL Sever? thanks (null)Re: how to improve the performance of Oracle Insert operation?
Problem when using SQL " Insert...." to AutoNumber.question: copy first N rows from table B to table A (DB2)
Oracle / DB2 问题Oracle 11g RAC on Virtual Machine
Anybody use postgreSQL?请教2个sql query 问题
还是DB2 好SQL-Help!
[转载] JDBC 处理日期的问题(日期插入数据库)How to insert a string into table? Thanks
相关话题的讨论汇总
话题: current话题: timestamp话题: insert话题: sql话题: postgresql
进入Database版参与讨论
1 (共1页)
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

1 (共1页)
进入Database版参与讨论
相关主题
How to insert a string into table? ThanksOracle / DB2 问题
JDBC<======================>Oracle8iAnybody use postgreSQL?
Special character in insert values还是DB2 好
请教一个sql server的问题[转载] JDBC 处理日期的问题(日期插入数据库)
MS T-SQL 问题请教一个问题,big data入库
[转载] database for Linux?How to insert image to DB2 ?
where can I download SQL Sever? thanks (null)Re: how to improve the performance of Oracle Insert operation?
Problem when using SQL " Insert...." to AutoNumber.question: copy first N rows from table B to table A (DB2)
相关话题的讨论汇总
话题: current话题: timestamp话题: insert话题: sql话题: postgresql