Java and Sybase nested stored procedures.
843854Dec 30 2003 — edited Jan 13 2004Hi!
I have nested Sybase stored procedures, the main procedure calls a helper stored proc.
The main procedure returns a result set to the Java code. When run through RapidSQL or anyother SQL tool the main procedure(and it's helper) execute well and returns rows.
The problem arises when I call the main stored procedure from Java program. The main stored procedure does not return any rows to the calling Java program. A check of stmt.execute is "false".
When I comment out the inner stored procedure the main procedure runs fine and returns the result set. The java code stmt.execute() returns "true" and is able to parse the resultset.
Any clues on why this is happening? Thank you.
~ RJ.
My Sybase stored procedure code looks like -
=======================================================================
create procedure main_proc
@param1 int
as
....
declare @return_val int
exec proc2 @param1, @return_val out
select myCol1,
myCol2,
myCol3=@return_val
from mytable
===========================================================================
Sybase Code for proc2
create procedure proc2
@param1 int,
@param2 int out
as
begin
if something exists(select * from table where whereClause)
select @param2="TRUE"
else
select @param2="FALSE"
end
go
GRANT EXECUTE...
EXEC sp_procxmode 'dbo.proc2,'unchained'
go
====================================================================