• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

ORA-00933 when calling a stored procedure

 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic