permaculture playing cards*
The moose likes JDBC and the fly likes DB2 error in Linux - Unexpected Token code=-104 and status=42601 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DB2 error in Linux - Unexpected Token code=-104 and status=42601" Watch "DB2 error in Linux - Unexpected Token code=-104 and status=42601" New topic
Author

DB2 error in Linux - Unexpected Token code=-104 and status=42601

Raj Metha
Greenhorn

Joined: Aug 04, 2004
Posts: 2
Hi all db2 gurus,
I am very new to db2. I am doing a java project which updates db2 using jdbc. Ok my update command will be like

UPDATE TbNme set acsright = ?, set userid =?, set dte =? where grp=? and acs=?

I will create a PreparedStatement and send the parameters. When executing i am getting db2exception :[IBM][CLI Driver][DB@] SQL0104N An Unexpected token "USERID" was found following "". Expected "=". code :-104 and status = 42601.

Anybody can help me. Thanks in advance.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Raj,
You can only have one "set" keyword in the query. Try:
UPDATE TbNme set acsright = ?, userid =?, dte =? where grp=? and acs=?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I'm used to:



Hi Jeanne, that happens, because I first had to start the database, to test my expection, which produced a new question, which I wrote first...
[ October 12, 2004: Message edited by: Stefan Wagner ]

http://home.arcor.de/hirnstrom/bewerbung
 
Consider Paul's rocket mass heater.
 
subject: DB2 error in Linux - Unexpected Token code=-104 and status=42601
 
Similar Threads
Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W
Resultset with million rows
CachedRowSet - Stored Procedure
JDBC DB/2 statement delimiter problem
Are arrays supported by DB2 Driver for WebSphere