I need help. I'm very new to PL/SQL and Oracle. Mainly transact SQL up to about a week ago. I need to get some information on using one of the above in the following manner:
I need to set column values on a schema.table to be named as a variable in a procedure. I realize that I need to create a cursor to look through the table and find the rows that need updating and setting the proper column flags. What I cannot figure out so far is how to pass the table name as a variable to the declare statement of the cursor. If anyone has info, please pass it along, I have chapters from a couple of books, but it is not making much sense. I could really use some examples.
Thanks from a newbie.
You cannot use tablenames as variables in cursors. In 8.1.6 you can use cursor variables with dynamic select statements.
type refcur_ty is ref cursor;
tablename := 'EMP';
open refcur for 'select * from '||tablename;
fetch refcur into emprec;
Click Here to Expand Forum to Full Width