当我尝试执行以下查询时,我在第 4 行遇到错误,例如“ORA-06512: at line 5”,其中“sample”是动态全局临时表。
declare max_seq_dp varchar2(20);
cnt number(20);
begin
execute immediate 'select count(*) into cnt from sample';
dbms_output.put_line(cnt);
if (cnt)>0 then
begin
select max(sequence_number) into max_seq_dp
from sample1 where column1 = '2045'
and is_active = 1;
dbms_output.put_line(max_seq_dp);
end;
end if;
end;
谢谢