Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get multiple row via a stored procedure
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