Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PL/SQL stored procedures

 
Ambrose R Tati
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I've got a Pl/Sql stored procedure declared as:
add_address(first_name in varchar2, last_name in varchar2) is
begin
....
end;
I'm trying to call it from within java:
...
CallableStatement storedProc =
con.prepareCall("begin add_address(?,?); end;");
storedProc.setString(1,"AAAA");
storedProc.setString(2,"BBBB");
storedProc.execute();
....
The following exception is being thrown:
java.Sql.SQLException:[Oracle][ODBC Oracle Driver][Oracle OCI] ORA-00900: Invalid SQL statement.

Could anybody please point me in the right direction?
Thanks in advance
Ambrose Tati
 
Kapil Agrawal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using 'Call' for calling your stored procedure as:
...
CallableStatement storedProc =
con.prepareCall("{call add_address(?,?)}");
storedProc.setString(1,"AAAA");
storedProc.setString(2,"BBBB");
storedProc.execute();

[This message has been edited by Kapil Agrawal (edited November 06, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic