views:

113

answers:

1

Hello,

Does open query exist in sybase ? Or more generally, in sybase, what are the possible way to select among the result of a procedure (temporary tables, out params, others ??)

A: 

You can specify output parameters for a stored procedure by adding the keyword "output" after the parameter in the "Create Procedure MyStoredProcedure..." command.

Temp Tables of course exist, local or Global.

T-SQL under Sybase IQ you can also select from a stored procedure so something like this, assume your procedure is called "MyStoredProcedure"

SELECT MyId from MyStoredProcedure()

Finally you can also create derived tables (at least it works in Sybase IQ) like this to join with your stored procedure results

SELECT t1.Name,t1.Address,t2.MyId FROM MyTable t1, (SELECT MyId FROM MyStoredProcedure()) t2 WHERE t1.MyId = t2.MyId

Kevin Horgan
Derived tables seems to be what I am looking for but does it work in sybase ase 12 ?
Toto
Unfortunately I have not worked with ASE for a while but I think the following link explains the process fairly well.http://www.sypron.nl/proctab.htmlI hope that helps.
Kevin Horgan