一个非常简单的问题 ,哪里错了?

hxy1982 2003-08-19 09:39:50
select police.t_ch_rec.id from police.t_ch_rec,police.t_ch_his
where police.t_ch_his.id=police.t_ch_rec.id
and police.t_ch_his.in_time=police.t_ch_rec.in_time;
begin
delete from police.t_ch_rec where police.t_ch_rec.id=vdeal_result;
end;
/


错误位于第2行:
ORA-06550: 行2、列57:
PLS-00201: 必须说明标识符'VDEAL_RESULT'
ORA-06550: 行2、列1:
PL/SQL: SQL Statement ignored
...全文
100 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hxy1982 2003-08-19
  • 打赏
  • 举报
回复
3q
hesi726 2003-08-19
  • 打赏
  • 举报
回复
//不理解你的意思以及表的结构
//猜想你的第二个错误应该如下改法
for vdeal_result in (select id from ***)
loop
delete from police.t_ch_rec where id = vdeal_result.id;
end loop;

// 第三个问题吗,
select min(id),max(id) into minid,maxid from ...
delete from ** where id>minid and id<maxid;



hxy1982 2003-08-19
  • 打赏
  • 举报
回复
删除不在最小记录和最大记录之间的记录怎么删除~!表同上~!!!
hxy1982 2003-08-19
  • 打赏
  • 举报
回复
帖错了,错误是:
delete from police.t_ch_rec where id = vdeal_result
*
错误位于第7行:
ORA-06550: 行7、列38:
PLS-00306: 调用'='时自变量数量或类型错误
ORA-06550: 行7、列1:
PL/SQL: SQL Statement ignored
nokia8310 2003-08-19
  • 打赏
  • 举报
回复
学了一招

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧