execute immediate 的问题
写了一个存储过程如下:create or replace procedure chang_preset_por(var_tbl IN VARCHAR2)
is
...........................................
type t_cursor is ref cursor;
preset_cur t_cursor;
var_sql varchar2(2000);
var_update varchar2(2000);
begin
var_sql:='
select DATA_FMT_DETAIL
from ' || var_tbl || '
where DATA_FMT = 2
for update of DATA_FMT_DETAIL nowait';
open preset_cur for var_sql;
fetch preset_cur into var_oldpreset;
..........................................
var_update := 'UPDATE ' || var_tbl || ' SET DATA_FMT_DETAIL= ''' || var_newpreset || ''' WHERE CURRENT OF preset_cur';
execute immediate var_update;
...........................................................
close preset_cur;
end chang_preset_por ;
运行到“execute immediate var_update;”时出错,请高手指教一下,是那里出了错??execute immediate和WHERE CURRENT OF不能在一起用吗???