Tar*_*run 5 oracle plsql relational-database oracle10g oracle11g
declare
type yy is table of t12.name%type index by binary_integer;
y yy;
n number:=1;
begin
execute immediate 'create table rat1 ( name varchar2(10) )';
commit;
select name bulk collect into y from t12;
for i in (select id,name from t12)
loop
dbms_output.put_line(y(n));
n:=n+1;
end loop;
forall i in y.first..y.last
insert into rat1 values(y(i));
end;
Run Code Online (Sandbox Code Playgroud)
它的给予ora-00942.我检查了一下...在某个网站上提到你必须提供以下特权...
grant select on sys.v_$paramenter to abc
Run Code Online (Sandbox Code Playgroud)
我也无法做到这一点.任何人都可以帮助我
Yah*_*hia 12
改变它,使它在两个连续的步骤中执行(不像现在这样在一个PL/SQL匿名块中):
首先这个
begin
execute immediate 'create table rat1 ( name varchar2(10) )';
commit;
end;
Run Code Online (Sandbox Code Playgroud)
然后作为第二块这个
declare
type yy is table of t12.name%type index by binary_integer;
y yy;
n number:=1;
begin
select name bulk collect into y from t12;
for i in (select id,name from t12)
loop
dbms_output.put_line(y(n));
n:=n+1;
end loop;
forall i in y.first..y.last
insert into rat1 values(y(i));
end;
Run Code Online (Sandbox Code Playgroud)
编辑 - 根据评论:
在执行之前,解析WHOLE PL/SQL块 - PL/SQL块中使用的所有对象必须在执行PL/SQL块之前存在...
| 归档时间: |
|
| 查看次数: |
23881 次 |
| 最近记录: |