Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to return a value from a SYBASE Stored Procedure

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
My SP outputs 2 values as follows : -
exec sp "1","2","3"
X Y
-- --
abc 0 where "1" "2" & "3" are the run-time variables.

I want to use the value of Y(always either 0 or 1) in
a subsequent query.
I cannot amend the SP to declare an extra variable with
OUTPUT option set.
My on-line SYBASE SQL manual suggests : -
declare @pset char(1)
exec sp "1","2","3", @Y = @pset output
but this doesn't work.
Can anyone help ?
 
Hiya,

Why can't you modify your stored procedure to give you an output variable? That is one of two ways that you can get a value back from a stored procedure that you can use, the other being to put the result into a table. Either of these will require you to modify your stored procedure.

Putting a variable for output into your EXEC clause will not work unless the variable has been declared for output in the stored procedure.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top