• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Merge command workd well , but gives ora-00905 in Java

 
Aju Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MERGE INTO emp et
using ( SELECT 7 eid FROM dual ) es
ON ( et.eid = es.eid )"
WHEN MATCHED THEN UPDATE
SET
et.CHECK_DEPT = 18


WHEN NOT MATCHED THEN
INSERT
( et.eID, et.CHECK_DEPT)
VALUES
( 7 ,18)
This works fine , but gives ora-00905 when I try to execute the same with Prepared Staement - Can anybody please help
Thanks
 
Jeremy Wilson
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the code for the prepared statement. Specifically I was wondering about the parameter used to set the 7,18 data.
 
Aju Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried giving some values initially from the program, but when it gave the above error I reduced it to just hardcoding the values and giving no '?'s in the PreparedStatement and giving the above string as such
&&& this works fine if I try it straight on database through toad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic