mikekwok
asked on
insert empty timestamp into db2 using jsp
I am using DB2. I want to insert a record using JSP.
The table is as follow :
COLUMN NAME: A (primary key) , B ,C
DATA TYPE: TIMESTAMP, DATE
I am using JSP to insert a record.
my sql statement is as follow :
INSERT INTO TBL_AAA VALUES ('P1','','')
however I get the follow error:
com.ibm.db2.jcc.c.SqlExcep tion: The syntax of the string representation of a datetime value is incorrect.
THE DATA SAMPLE IS AS FOLLOW:
P2, FEB 3,2005 2:40:03 PM 218000 , DEC 14, 2004
Would somebody please help me ?
The table is as follow :
COLUMN NAME: A (primary key) , B ,C
DATA TYPE: TIMESTAMP, DATE
I am using JSP to insert a record.
my sql statement is as follow :
INSERT INTO TBL_AAA VALUES ('P1','','')
however I get the follow error:
com.ibm.db2.jcc.c.SqlExcep
THE DATA SAMPLE IS AS FOLLOW:
P2, FEB 3,2005 2:40:03 PM 218000 , DEC 14, 2004
Would somebody please help me ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Obviously, you need to close the statement, catch the exceptions, etc...
ASKER
Actually the table contains more than 3 column, therefore I cannot use INSERT INTO TBL_AAA VALUES( 'P1' )
You can do:
INSERT INTO TBL_AAA ( COLUMNNAME ) VALUES ( 'P1' )
to just insert into a single column :-)
Good luck!!
Tim
INSERT INTO TBL_AAA ( COLUMNNAME ) VALUES ( 'P1' )
to just insert into a single column :-)
Good luck!!
Tim
why not just do:
INSERT INTO TBL_AAA VALUES( 'P1' )
?