my dog learned polymorphism*
The moose likes Websphere and the fly likes I am getting error likeSQLCODE: -104, SQLSTATE: 42601 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "I am getting error likeSQLCODE: -104, SQLSTATE: 42601" Watch "I am getting error likeSQLCODE: -104, SQLSTATE: 42601" New topic
Author

I am getting error likeSQLCODE: -104, SQLSTATE: 42601

sachin pate
Greenhorn

Joined: May 03, 2013
Posts: 19
I am using following query
INSERT INTO IIS.ADMIN_AUDIT(ACCESS_USER,ACCESS_TIME,ACCESS_TYPE,FUNCTION,ACTION_INFO)
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

If this really is the entire statement you're executing, then you're missing the values to insert - either the VALUES clause, or the SELECT clause.
Harneet Singh
Greenhorn

Joined: Feb 05, 2013
Posts: 18
Agree with MARTIN , an INSERT statement is incomplete without the VALUES , unless you have not posted entire query.
sachin pate
Greenhorn

Joined: May 03, 2013
Posts: 19

INSERT INTO IIS.AUDIT
(
ACCESS_USER,
ACCESS_TIME,
ACCESS_TYPE
)
VALUES (
's12345',
CURRENT TIMESTAMP,
'GET PART INFORMATION'
);
console output as follows

[9/29/13 13:41:22:806 GMT+05:30] 00000020 SystemErr R com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: ;;INFORMATION'
);END-OF-STATEMENT
[9/29/13 13:41:22:806 GMT+05:30] 00000020 SystemErr R at com.ibm.db2.jcc.b.id.e(id.java:1640)
[9/29/13 13:41:22:806 GMT+05:30] 00000020 SystemErr R at com.ibm.db2.jcc.b.id.b(id.java:1197)
[9/29/13 13:41:22:806 GMT+05:30] 00000020 SystemErr R at com.ibm.db2.jcc.c.fb.i(fb.java:234)
[9/29/13 13:41:22:806 GMT+05:30] 00000020 SystemErr R at com.ibm.db2.jcc.c.fb.b(fb.java:50)

Please let me i am doing wrong.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Does this command work when run from an SQL client? And if it does, can you post the Java code that executes it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I am getting error likeSQLCODE: -104, SQLSTATE: 42601