Click to See Complete Forum and Search --> : Stored Procedure Compilation Error


pravin
09-16-2003, 03:28 AM
i have written a small procedure ,which stores the data in a table.
and while calling it from the java code,itz throwing invalid object
(invalid procedure name).
while we compile it in sql,itz getting compile with no errors.

please let me know where it is wrong.

THE STORED PROCEDURE CODE
==========================
create or replace procedure st_proc as
declare id number;
begin
select word_id into id from words ;
insert into words_desc values(id,'desc for first word');
end;


java code:
=========
try
{
con = getDBConnection();
System.out.println("con = "+con);
cs = con.prepareCall("{call st_proc}");
System.out.println("cs = "+cs);
cs.execute();
}catch(SQLException e)
{
e.printStackTrace(System.out);
System.out.println("................");
System.out.println(e);
}finally
{
try{
cs.close();
con.close();
}catch(Exception e){}
}

Srinivas_Sharma
09-16-2003, 04:28 AM
Hi,

Try to put it in a package and call it using

pkgname.procedurename in ur java code.......

Even i dont see any problems in the code.

HTH

Srini

stancho
09-16-2003, 06:24 AM
Originally posted by pravin

cs = con.prepareCall("{call st_proc}");

cs = con.prepareCall("begin st_proc; end;"); I think :confused: