Re: How to get multiple rows via a stored procedure

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au>
Date: 1997/10/16
Message-ID: <01bcd9e8$04b2d480$d33c1286_at_itwol-pc3963.itwol.bhp.com.au>#1/1


Hi,
[Quoted] In PL/SQL you must Open and Fetch a Cursor whenever more than one row may be returned by a query.
Open the Cursor and put the Fetch in a loop to process each row in turn, eg. a While loop with a test of <cursor-name>%FOUND. Then Close the Cursor after the loop.
If you're not familiar with cursors then look for a manual on the PL/SQL Programming Language.

Price Waterhouse LLP <user_at_msn.com> wrote in article <01bcd813$2a4b7de0$eb322299_at_nakhtar.us.pw.com>...
> Hello,
>
> I am developing an application in VC++ and accessing the Oracle database
> via ODBC. I have to access the data via stored procedure. I created a
> stored procedure in Oracle as:
> Create stored procedure....
> and in the body
> ()
> is empname employee.name%TYPE;
> Begin
> select name into empname from employee;
> end;
>
> since this will return multiple records the sqlplus complains and can't
> execute it and if I try to execute it via ODBC, I get the same error
> message.
>
> Is this possible at all in Oracle. I have to make my application
 compatible
> with Access and Oracle. This method does work in Access. Although
 Access
> stored procedure are Predefined queries.
>
> Thanks in advance.
>
> n_akhtar_at_msn.com
>
>
>
>
>
Received on Thu Oct 16 1997 - 00:00:00 CEST

Original text of this message