我执行以下查询:
declare
i number;
begin
execute immediate 'select count(1) from someTable' returning into i;
dbms_output.put_line(i);
end;
,得到这个错误:返回子句必须与插入,更新和删除使用!
只是一个小语法错误(没有返回):
DECLARE
i NUMBER;
BEGIN
EXECUTE IMMEDIATE 'select count(1) from user_tables' INTO i;
dbms_output.put_line(i);
END;