直接open cur from sql;即可。
例子:
create or replace procedure test(tableName varchar2) is TYPE cur_type IS REF CURSOR; cur cur_type; ajob varchar2(255 char); curSql varchar2(255 char); begin cursql :='select job from '||tableName; dbms_output.put_line('cursql'||cursql); open cur for cursql; loop fetch cur into ajob; exit when cur%notfound; update emp set job=job||'1' where job=ajob; dbms_output.put_line('ajob'||ajob); end loop; close cur; end;