Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

select from the result of a stored procedure

2 posts in General Discussion Last posting was on 2003-07-23 17:03:08.0Z
MikeD Posted on 2003-07-23 17:03:08.0Z
From: MikeD
Date: Wed, 23 Jul 2003 13:03:08 -0400
Newsgroups: ianywhere.public.general
Subject: select from the result of a stored procedure
Message-ID: <C53FE78A7CA1CF21005DABBA85256D6C.005DABCC85256D6C@webforums>
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1439
Article PK: 3672

How can I select from the result of a stored procedure?

EXEC SQL CREATE PROCEDURE dba.GetCustomerInvoiceNumbers(CustomerID integer)
RESULT( InvoiceNumber integer )
BEGIN
SELECT InvoiceNumber FROM invoice
WHERE CustomerID = CustomerID ;
END;

// The following doesn't work, but represents what I want to do
SELECT * FROM dba.GetCustomerInvoiceNumbers
WHERE InvoiceNumber > 1

Thanks


Paul Horan[TeamSybase] Posted on 2003-07-23 16:54:12.0Z
From: "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom>
References: <C53FE78A7CA1CF21005DABBA85256D6C.005DABCC85256D6C@webforums>
Subject: Re: select from the result of a stored procedure
Date: Wed, 23 Jul 2003 12:54:12 -0400
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OqnjCxTUDHA.298@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: ny-chicagost2a-69.buf.adelphia.net 24.49.97.69
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1440
Article PK: 3673

Write the proc to insert to a temp table, then select * from the temp table.
Or wait until ASA9 comes out, when you'll be able to select across procedures that return result sets.

--
Paul Horan[TeamSybase]
VCI Springfield, MA
www.vcisolutions.com

Techwave2003 is coming!
http://www.sybase.com/techwave2003
PWB515 - Introduction to Source Code Control with PB9

<MikeD> wrote in message news:C53FE78A7CA1CF21005DABBA85256D6C.005DABCC85256D6C@webforums...
> How can I select from the result of a stored procedure?
>
> EXEC SQL CREATE PROCEDURE dba.GetCustomerInvoiceNumbers(CustomerID integer)
> RESULT( InvoiceNumber integer )
> BEGIN
> SELECT InvoiceNumber FROM invoice
> WHERE CustomerID = CustomerID ;
> END;
>
> // The following doesn't work, but represents what I want to do
> SELECT * FROM dba.GetCustomerInvoiceNumbers
> WHERE InvoiceNumber > 1
>
> Thanks
>
>
>