|
-
You cannot use tablenames as variables in cursors. In 8.1.6 you can use cursor variables with dynamic select statements.
declare
type refcur_ty is ref cursor;
refcur refcur_ty;
emprec emp%rowtype;
tablename varchar2(30);
begin
tablename := 'EMP';
open refcur for 'select * from '||tablename;
fetch refcur into emprec;
close refcur;
dbms_output.put_line(emprec.ename);
end;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|