Posted: Mon Jul 08, 2002 2:18 am Post subject: using ESQL to insert into smalldatetime type in SQL server
Newbie
Joined: 04 Jun 2002 Posts: 8 Location: Taiwan
hi,
I have problem in inserting data using ESQL to a SQL database to a column where the data type is smalldatetime, does anyone has any
clue what may have gone wrong?
We do a test ,
When
INSERT INTO Database.WODS_T(Ship_Date)
VALUES('2002-07-12 13:13:13');
It work.
But when
DECLARE DT AS TIMESTAMP;
SET DT = CURRENT_TIMESTAMP;
SET DT2 = SUBSTRING(CAST(DT AS CHAR) FROM 12 FOR 19);
INSERT INTO Database.WODS_T(Ship_Date)
VALUES(DT2);
It failed and got SQL State '22008' Datetime overflow
And interesting is in user trace we sow the SQL command is
INSERT INTO WODS_T(Ship_Date) VALUES('2002-07-12 13:13:13:');
and
INSERT INTO WODS_T(Ship_Date) VALUES(?). Parameter is ''2002-07-12 13:13:13''.
The different is only from values or given by parameters list.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum