declare
cursor discursor is select no from angle.test;
cursorno angle.test.no%type;
tempno angle.test.no%type:=0;
flag number(1):=0;
begin
for cursorno in discursor
loop
if (tempno=cursorno.no and flag>0) then
delete from angle.test where no=cursorno;
else
tempno:=cursorno;
end if;
flag:=flag+1;
end loop;
end;
/
上边是小弟我写的一个从表angle.test中删除重复记录的程序,但是编译时出现如下错误,哪位大侠指点一下啊!ERROR 位于第 10 行:
ORA-06550: 第 10 行, 第 35 列
PLS-00382: 表达式类型错误
ORA-06550: 第 12 行, 第 11 列
PLS-00382: 表达式类型错误
ORA-06550: 第 12 行, 第 3 列
PL/SQL: Statement ignored
cursor discursor is select no from angle.test;
cursorno angle.test.no%type;
tempno angle.test.no%type:=0;
flag number(1):=0;
begin
for cursorno in discursor
loop
if (tempno=cursorno.no and flag>0) then
delete from angle.test where no=cursorno;
else
tempno:=cursorno;
end if;
flag:=flag+1;
end loop;
end;
/
上边是小弟我写的一个从表angle.test中删除重复记录的程序,但是编译时出现如下错误,哪位大侠指点一下啊!ERROR 位于第 10 行:
ORA-06550: 第 10 行, 第 35 列
PLS-00382: 表达式类型错误
ORA-06550: 第 12 行, 第 11 列
PLS-00382: 表达式类型错误
ORA-06550: 第 12 行, 第 3 列
PL/SQL: Statement ignored
解决方案 »
- 时间转换问题
- TNS:失去联系
- 请教 分解逗号分隔的字符串
- oracle入门问题
- 手动执行应用程序ok,但用crontab(在正确的用户名下)运行应用程序就报-12545(tns连接错误),怎么解决?
- TNSlistener服务无法启动,添加 ImagePath后还是无法启动
- 我想用SELECT查询最后50条记录,应该怎么做啊?
- oracle有存储过程吗?
- 取最大值时 是否有好办法将相应的其他字段的值一并取出?
- PROC问题:在proc程序中通过database link 往另外的库中insert时没反应,但在sqlplus中手工插入可以
- 将excel中数据导入oracle
- linux下,orcale9 狂吃内存,shutdown之后也没有释放内存,怎么办
Delete from table1 a where rowid!=
(
select max(rowid) from table1 b on a.col1=b.col1
)