Link to home
Start Free TrialLog in
Avatar of mikekwok
mikekwokFlag for Hong Kong

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.SqlException: 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 ?
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image


why not just do:

INSERT INTO TBL_AAA VALUES( 'P1' )

?
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Obviously, you need to close the statement, catch the exceptions, etc...
Avatar of mikekwok

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