创建出错时使用: show errors查看具体的错误提示
一. 存储过程中的一个循环及变量引用示例:
create or replace procedure my_pro
is
cursor cur is select distinct tzname as name from V$TIMEZONE_NAMES order by name;
x varchar(1024);
y varchar(1024);
z varchar(1024);
begin
for info in cur LOOP
y:=info.name;
z:='alter session set time_zone='''||y||'''';
execute immediate z;
dbms_output.put_line(z);
select sessiontimezone into x from dual;
dbms_output.put_line(x);
end LOOP;
end;
/