【发布时间】:2023-02-10 16:35:36
【问题描述】:
我用的是informix数据库。我需要将当前日期和当前时间插入列类型为“datetime year to second”的列中。
例子:
INSERT INTO example_table (my_example_date) VALUES( ??? );
它是如何工作的?
【问题讨论】:
-
...VALUES (CURRENT)?
我用的是informix数据库。我需要将当前日期和当前时间插入列类型为“datetime year to second”的列中。
例子:
INSERT INTO example_table (my_example_date) VALUES( ??? );
它是如何工作的?
【问题讨论】:
...VALUES (CURRENT)?
current 是你想要使用的,这里是我测试过的一个完整的工作示例:
create table example_table (my_example_date datetime year to second);
INSERT INTO example_table (my_example_date) VALUES( current );
select * from example_table;
给出:
2023-02-10 09:21:00.000
【讨论】: