informix

来源:互联网 发布:淘宝直播合作 编辑:程序博客网 时间:2024/04/28 22:47

 

 

日期时间型


CREATE TABLE test_table_3(
col1 datetime year TO second,
col2 date,
col3 integer);

 

 

INSERT INTO test_table_3(col1) values(to_date( '2003-5-4 21:00:01', '%Y-%m-%d %H:%M:%S'));
INSERT INTO test_table_3(col2) values(to_date( '2003-5-4 21:00:01', '%Y-%m-%d %H:%M:%S')); ///< 可以插入
INSERT INTO test_table_3(col2) values(to_date( '2003-5-4 21:00:01', '%YYYY-%mm-%dd %H:%M:%S')); ///< 错误(%YYYY-%mm-%dd)

 

SELECT to_char(col1,'%m-%Y-%D %M-%S-%H') FROM test_table_3;

 

 

SERIAL列


CREATE TABLE test_table_2
(f001n_0002 serial,
f002v_0002 char(30));

 

INSERT INTO test_table_2(f002v_0002) values('s');


SELECT DBINFO( 'sqlca.sqlerrd1' )
FROM systables
WHERE tabid = 1;

 

参考资料:

(1)http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqlr.doc/sqlrmst109.htm

(2)http://userweb.port.ac.uk/~msm/docs/informix/

(3)http://database.51cto.com/art/200512/13433.htm