Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get multiple row via a stored procedure

Re: How to get multiple row via a stored procedure

From: Slawek Smyl <slsmyl_at_ibm.net>
Date: 1997/10/17
Message-ID: <344739C3.4881955D@ibm.net>#1/1

Hi,
I would like to join in and ask how do you deal with ROWTYPE type at C (ODBC) code level.

Thanks,
Slawek Smyl

Dan Clamage wrote:

> PROCEDURE get_employee_by_state(
> Prec IN OUT employee%ROWTYPE, -- input is a key, output is whole
> record
> Poperation IN VARCHAR2, -- 'O' for Open, 'C' for Close, 'F' for
> Fetch
> Pstatus IN OUT NUMERIC) IS -- success or failure of operation
> BEGIN
> -- perform the requested operation
> IF (Poperation = OP_FETCH) THEN
> FETCH get_emps_by_state INTO Prec;
> ELSIF (Poperation = OP_OPEN) THEN
> OPEN get_emps_by_state(Prec.state); -- open the cursor using state
> ELSIF (Poperation = OP_CLOSE) THEN
> CLOSE get_emps_by_state;
> ELSE -- invalid operation
> NULL; -- do some kind of error handling here (maybe raise exception)
> END IF; -- perform an operation
> Pstatus := SQLCODE; -- capture success or failure
> EXCEPTION
> WHEN OTHERS THEN
> Pstatus := SQLCODE;
> NULL; -- do some kind of error handling here too
> END get_employee_by_state;
> END emp_pkg;
> /
>
Received on Fri Oct 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US