Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Problems: SQLSTATE=42601

843854Sep 13 2004 — edited Sep 15 2004
Hi JavaGurus, i am updating the db2 database by using the following command
String updatecommand ="insert into patient values ("+did+", '"+PFN+"' , '"+PLN+"','"+ADDR+"','"+CT+"', '"+ST+"',"+ZP+","+PH+",'"+US+"','"+PS+"')";
stmt.executeUpdate(updatecommand);
if i give the values of all the fields then everything works fine. But if i skip any of the fields it gives an error saying
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected
token "," was found following "sfd' , '','','', '',". Expected tokens may incl
ude: "<rvc_element>". SQLSTATE=42601
Is there a way that i can tell the program to give the error message "saying that all the fields are required" please help me as soon as possible.in my database all the fields by default are notnullable
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2004
Added on Sep 13 2004
9 comments
1,842 views