0

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 ??)

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
Toto
  • 7,491
  • 18
  • 50
  • 72

1 Answers1

0

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
Adam Wenger
  • 17,100
  • 6
  • 52
  • 63
Kevin Horgan
  • 1,590
  • 16
  • 20
  • Derived tables seems to be what I am looking for but does it work in sybase ase 12 ? – Toto Nov 16 '09 at 14:08
  • 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.html I hope that helps. – Kevin Horgan Nov 17 '09 at 18:22
  • derived tables came with Sybase ASE 12.5.1 – Burcin Sep 09 '15 at 17:08