Link to home
Start Free TrialLog in
Avatar of FarazMSyed
FarazMSyed

asked on

cursor_type emp%rowtype

here is my problem ....

i need to create a procedure e.g
Create or replace procedure abc
(cur_type emp%rowtype);
...... and so on

if i need to call this procedure in a pl/sql block e.g.

declare
cur c1 is select * from emp;
begin
for rec in c1 loop
abc(cursor_type);
blah blah ...

my point is i need to dynamic this cursor_type ...  whatever table I select in c1 i wouldn't change that abc procedure with cursor_type emp%rowtype to
dept%rowtype (if i am selecting from dept table in c1 cursor)... there must be something dynamic in it ... i hope i clear my point ...if anyone have any idea to solve it ....

tx
Avatar of Irka
Irka

Use DBMS_SQL package
ASKER CERTIFIED SOLUTION
Avatar of Grinberg
Grinberg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
u cannot use %rowtype in procedures straight away in declaration statements. but u can define a cursor inside the body and then return the result in a variable which can be dynamically called in sql.
Avatar of FarazMSyed

ASKER

Guys!!!
thanx for your help i think Grinberg has given me the solution ...

thanx again
Faraz