File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes ORA-00933 when calling a stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "ORA-00933 when calling a stored procedure" Watch "ORA-00933 when calling a stored procedure" New topic
Author

ORA-00933 when calling a stored procedure

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6588
    
    1

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 ]

SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
You probably have a bug in your Java code, causing you to bind the wrong data to the variables.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6588
    
    1

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORA-00933 when calling a stored procedure
 
Similar Threads
@ManyToOne mapping question
conversion of date
SQLException Cursor Closed
Query throwing “Invalid column name” error.
Error calling stored procedure !!