469,590 Members | 2,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

INSERT into ... VALUES (TIMESTAMP) problem...

I just receive an error during my CLI ODBC insert statement:
INSERT INTO (.....) VALUES (?, ?, ?, TIMESTAMP( CAST(? AS
VARCHAR(10)),'00:00:00'), ?, ?, ?, ?)";

the ? in the CAST( ) Statement is represented by:
char *go03_btag="10.10.2006";

SQLCODE = -180, SQLSTATE = 22008
MESSAGE: [unixODBC][IBM][CLI Driver][DB2/LINUX] SQL0180N The syntax
of the string representation of a datetime value is incorrect.
SQLSTATE=22007

anyone any idea?
thanks,
Klaus

Dec 18 '06 #1
2 44163
hi,

I tried a sample insert and it worked.

------------------------------ Commands Entered
------------------------------
insert into db2nci.test values (TIMESTAMP(CAST('10.10.2006' AS
VARCHAR(10)),'00:00:00'));
------------------------------------------------------------------------------
insert into db2nci.test values (TIMESTAMP(CAST('10.10.2006' AS
VARCHAR(10)),'00:00:00'))
DB20000I The SQL command completed successfully.

RainDeEr

Dec 18 '06 #2
rAinDeEr wrote:
hi,

I tried a sample insert and it worked.

------------------------------ Commands Entered
------------------------------
insert into db2nci.test values (TIMESTAMP(CAST('10.10.2006' AS
VARCHAR(10)),'00:00:00'));
------------------------------------------------------------------------------
insert into db2nci.test values (TIMESTAMP(CAST('10.10.2006' AS
VARCHAR(10)),'00:00:00'))
DB20000I The SQL command completed successfully.

RainDeEr
May depend on the LOCALE. Try e.g. 10-10-2006

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
http://www.iiug.org/waiug/present/Fo...Forum2006.html
Dec 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sirisha | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.