PROCEDURE SCOTT.P_TFBTRADEINTERSENDTO_HIS 编译错误 错误:PLS-00225: 子程序或游标 'CUR' 引用超出范

a1905341986 2015-10-17 11:05:59
CREATE OR REPLACE PROCEDURE P_TFBTRADEINTERSENDTO_HIS IS
V_NUM NUMBER(9);

cursor cur is
SELECT TRADE_ID,
SUBSCRIBE_ID,
INFACE_TYPE,
DEAL_STATE,
IN_DATE,
PROVINCE_CODE,
ROWID
FROM TF_B_TRADE_INTER_SEND A
WHERE A.DEAL_STATE = '1';

BEGIN
for i in cur loop
SELECT count(*)
into v_num
FROM TF_B_TRADE_INTER_SEND_HIS A
WHERE A.TRADE_ID = cur.TRADE_ID
AND SUBSCRIBE_ID = cur.SUBSCRIBE_ID
AND DEAL_STATE = cur.DEAL_STATE
AND INFACE_TYPE = cur.INFACE_TYPE
AND IN_DATE = cur.IN_DATE
AND PROVINCE_CODE = cur.PROVINCE_CODE;

IF (v_num = 0) then
insert into TF_B_TRADE_INTER_SEND_HIS
select * from TF_B_TRADE_INTER_SEND where ROWID = cur.ROWID;
END IF;

delete from TF_B_TRADE_INTER_SEND where ROWID = cur.ROWID;
COMMIT;
end loop;
END;

create table TF_B_TRADE_INTER_SEND
(
TRADE_ID NUMBER(16) not null,
INFACE_TYPE VARCHAR2(3) not null,
DEAL_STATE VARCHAR2(3) not null,
DEAL_MSG VARCHAR2(4000) not null,
RESEND_COUNT NUMBER,
DEAL_DATE DATE,
IN_DATE DATE not null,
NOTES VARCHAR2(4000),
PROVINCE_CODE VARCHAR2(6) not null,
SEND_CONTENT VARCHAR2(200),
SUBSCRIBE_ID VARCHAR2(30) not null
)

create table TF_B_TRADE_INTER_SEND_HIS
(
TRADE_ID NUMBER(16) not null,
INFACE_TYPE VARCHAR2(3) not null,
DEAL_STATE VARCHAR2(3) not null,
DEAL_MSG VARCHAR2(4000) not null,
RESEND_COUNT NUMBER,
DEAL_DATE DATE,
IN_DATE DATE not null,
NOTES VARCHAR2(4000),
PROVINCE_CODE VARCHAR2(6) not null,
SEND_CONTENT VARCHAR2(200),
SUBSCRIBE_ID VARCHAR2(30) not null
)
PROCEDURE SCOTT.P_TFBTRADEINTERSENDTO_HIS 编译错误

错误:PLS-00225: 子程序或游标 'CUR' 引用超出范围
行:18
文本:into v_num

错误:PL/SQL: ORA-00904: "CUR"."PROVINCE_CODE": 标识符无效
行:18
文本:into v_num

错误:PL/SQL: SQL Statement ignored
行:12
文本:FROM TF_B_TRADE_INTER_SEND A

错误:PLS-00225: 子程序或游标 'CUR' 引用超出范围
行:22
文本:AND DEAL_STATE = cur.DEAL_STATE

错误:PL/SQL: ORA-00904: "CUR"."ROWID": 标识符无效
行:22
文本:AND DEAL_STATE = cur.DEAL_STATE

错误:PL/SQL: SQL Statement ignored
行:21
文本:AND SUBSCRIBE_ID = cur.SUBSCRIBE_ID

错误:PLS-00225: 子程序或游标 'CUR' 引用超出范围
行:25
文本:AND PROVINCE_CODE = cur.PROVINCE_CODE;

错误:PL/SQL: ORA-00904: "CUR"."ROWID": 标识符无效
行:25
文本:AND PROVINCE_CODE = cur.PROVINCE_CODE;

错误:PL/SQL: SQL Statement ignored
行:25
文本:AND PROVINCE_CODE = cur.PROVINCE_CODE;
...全文
998 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
a1905341986 2015-10-17
  • 打赏
  • 举报
回复
求人帮忙解答一下

3,490

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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