• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORA-00933 when calling a stored procedure

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am calling a stored procedure from java like so...

call DE.PR_NAME (? , ? , to_date(? , 'mm/dd/yyyy') , ?)

I am using a CallableSQL to call this procedure and i fill in a parameter list which results in the call shown below. I got that from a debug statement on the console.

call DE.PR_NAME (8 , 1223, to_date('04/30/2004' , 'mm/dd/yyyy'), 9)

I get the error ORA-00933 when i try to do an executeUpdate() on this SQL, however when i copy and run it on the database it works fine. Why does this problem occur ? I have also tried the same with a CallableStatement and there is no difference. I get the same error. Have any of you encountered such problems ? Please help. Java version is 1.3.1 with oracle 9i for the back end support. Here is the partial stack trace. HELP !!!

java.sql.SQLException: ORA-00933: SQL command not properly ended
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
[ August 03, 2006: Message edited by: John Meyers ]
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably have a bug in your Java code, causing you to bind the wrong data to the variables.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think it has to do with wrong data, because i am able to execute the stored procedure from the DB using the exact same SQL that the java application has spit out on the console. What puzzles me is... why wont this query work if i try to execute it from the application ?. After all it did execute successfully in the DB. The stored procedure only takes inputs and it does not return any values. I know for sure that the application is making an attempt to execute the procedure because if i pass the wrong date format it throws a SQLException that reads " Invalid month ". Any ideas on why this is happening ? Any suggestion is greatly appreciated.

Thank you
[ August 03, 2006: Message edited by: John Meyers ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic