我想在存储过程中使用游标.把mytable表中的数据取出来插入temTable(临时表)中去.但是老是报错.不知道是什么原因.请大家指点一下
LINE/COL ERROR
-------- -----------------------------
7/3 PL/SQL: Statement ignored
7/17 PLS-00201: 必须说明标识符 'MYCORSOR '
create or replace package body mypackage is
procedure doit is
cursor mycursor is select * from mytable;
theRow mycursor%rowType;
begin
for theRow in mycorsor loop
insert into temTable values(theRow.id,theRow.name,theRow.palce);
end loop;
end doit;
end mypackage;
------解决方案--------------------
create or replace package body mypackage is
procedure doit is
cursor mycursor is select * from mytable;
theRow mycursor%rowType;
begin
for theRow in mycorsor loop --写错了 mycorsor 改成 mycursor
insert into temTable values(theRow.id,theRow.name,theRow.palce);
end loop;
end doit;
end mypackage;
--定义的时候是mycursor,你用的时候写成了mycorsor
代码迷推荐解决方案:oracle存储过程,http://www.daimami.com/search?q=177537