|
-
Stored Procedure Compilation Error
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){}
}
-
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
-
Re: Stored Procedure Compilation Error
Originally posted by pravin
cs = con.prepareCall("{call st_proc}");
cs = con.prepareCall("begin st_proc; end;"); I think
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|