Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a %rowtype record as a parameter 1

Status
Not open for further replies.

gacaccia

Technical User
Joined
May 15, 2002
Messages
258
Location
US
can a %rowtype record be used as a parameter for a procedure?

for example, if i have...

Code:
declare
     cursor c is select * from tblName;
     rs c%rowtype;

     procedure proc(???how to pass in rs here???)
     begin
         ...
     end;

is there a way to pass rs into the procedure?
 
Gacaccia,

The data type definition for a procedure's argument(s) can be either explicit ("NUMBER", "VARCHAR", "DATE", et cetera) or implicit ("...%ROWTYPE"). But the implicit definition can point only to a table, a cursor, or a cursor variable. Therefore, the closest you can to using "rs" as an implicit procedure-argument definition is:
Code:
declare
     cursor c is select * from s_emp;
     rs c%rowtype;
     procedure proc(x c%rowtype) is
     begin
         null;
     end;
begin
     null;
end;
/

PL/SQL procedure successfully completed.
Since "c" always defines "rs's" format, is not the above an adequate alternative?


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
exactly what i was looking for. thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top