Errors in file /orasoft/oracle8i/app/oracle/admin/ora817/bdump/snp2_1324_ora817.trc:
ORA-12012: error on auto execute of job 52
ORA-02074: 无法在分布式事务处理中ROLLBACK
ORA-06512: 在"YYBH.PRO_XLTTOZNW", line 221
ORA-02041: 客户数据库未开始一个事务处理
ORA-06512: at "DDDD.PRO_DD_JOB_ZNW", line 4
ORA-06512: at line 1
这个JOB调用的存储过程如下回复
JOB运行一段时间后报错死掉,需要人工激活,系统日志就是上面所写的错误,请大家帮忙找出问题出来,谢谢。
10 个解决方案
#1
create or replace procedure yybh.pro_xlttoznw
as
cursor cur_znw is select a.slbh,a.ywlb,a.slfs, rowid from dlb_znw a ; --将队列表中的内容取出
v_ckfwxm varchar2(30) ; --程控服务项目
v_psid varchar2(20) ; --小灵通鉴权码
v_dhhm varchar2(8) ; -- 电话号码
v_ldxs varchar2(1); --来电显示
v_hcxz varchar2(1); --呼出限制
v_wtjzy varchar2(1); --无条件呼叫转移
v_ymzy varchar2(1); --遇忙转移
v_wydzy varchar2(1); --无应答转移
v_hjdd varchar2(1); --呼叫等待
v_mdrfw varchar2(1); --免打扰服务
v_qxyhfw varchar2(1); --缺席用户服务
v_nzfw varchar2(1); --闹钟服务
v_slbh varchar2(20); --受理编号
--t_dhhm varchar2(13); --临时电话号码
V_XDHHM VARCHAR2(8);
v_rowid varchar2(20);
v_ywlb varchar2(4);
v_slfs varchar2(4);
v_oldpsnum varchar2(15);
v_newpsid varchar2(11);
v_dxxfw varchar2(2);
v_misscall varchar2(1);
begin
open cur_znw;
loop
fetch cur_znw into v_slbh,v_ywlb,v_slfs ,v_rowid;
exit when cur_znw%NOTFOUND;
--01 用户放号
if (v_ywlb='FA11') --如果是新装机用户
then
begin
select dhhm,jqm into v_dhhm,v_psid from xlt_jqm where slbh=v_slbh ;
exception
when others then
begin
insert into dlb_znw_fault select * from dlb_znw where slbh=v_slbh ;
delete from dlb_znw where slbh=v_slbh;
commit;
CLOSE CUR_ZNW ;
return ;
end ;
end;
insert into adduser_interface@to_xlt (PSID ,PSNUM,PSIDFLAG,TOLLCODE ,CANUM,COMMANDTYPE, PRIORITY)
values (nvl(v_psid,'0000'),'86715'||v_dhhm ,'0', '715','咸宁','01',1);
--用户开通成功
select DECODE(SUBSTR(CKFWXM,1,2),'22','0','11','0','00','3','20','2','10','2','4') into v_hcxz from gdb_dh where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
insert into mododb_interface@to_xlt (PSNUM,SUBSTATE,BAROUT,BARIN,BARPRC,BARFWD,BARIP,BARSS ,BARAUTH,COMMANDTYPE ,PRIORITY)
values ('86715'||v_dhhm ,'1',v_hcxz,'0','0','0','0','0','0','05',2);
--向MODSS_INTERFACE表中插入数据
insert into modss_interface@to_xlt
(PSNUM,CLIP,CFU,CFB,CFNRY,CFNRC,CW,CH,FFI,ASS,ASNZ,SN,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,decode(substr(v_ckfwxm,17,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,4,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,24,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,7,1),'2','1','1','1',''),
'',decode(substr(v_ckfwxm,11,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,12,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,8,1),'2','1','1','1',''),'','06',2)
;
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,decode(substr(v_ckfwxm,26,1),'3','00','2','11','1','11','0','00','11'),'2','86710003000','0','1',sysdate,'08',4) ;
end if ;
--02 用户销户
if (v_ywlb='FA21')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into DELUSER_INTERFACE@to_xlt (PSNUM,COMMANDTYPE,PRIORITY )
values ('86715'||v_dhhm , '02',1);
--注销XLT_JQM中的数据
delete from xlt_jqm where dhhm=v_dhhm ;
end if ;
---数据修改完毕
--用户换PSID
if (v_ywlb='FA4M')
then
--处理过程
select oldpsnum,newpsid into v_oldpsnum,v_newpsid from dlb_znw where rowid=v_rowid;
insert into modpsid_interface@to_xlt (OLDPSNUM,NEWPSID,COMMANDTYPE,PRIORITY) values(v_oldpsnum , v_newpsid,'04',5);
-- UPDATE XLT_JQM SET JQM=V_NEWPSID WHERE DHHM=SUBSTR(V_OLDPSNUM,5,7);
-- 更改PSID的任务在程序中已经实现
end if ;
后面还有
as
cursor cur_znw is select a.slbh,a.ywlb,a.slfs, rowid from dlb_znw a ; --将队列表中的内容取出
v_ckfwxm varchar2(30) ; --程控服务项目
v_psid varchar2(20) ; --小灵通鉴权码
v_dhhm varchar2(8) ; -- 电话号码
v_ldxs varchar2(1); --来电显示
v_hcxz varchar2(1); --呼出限制
v_wtjzy varchar2(1); --无条件呼叫转移
v_ymzy varchar2(1); --遇忙转移
v_wydzy varchar2(1); --无应答转移
v_hjdd varchar2(1); --呼叫等待
v_mdrfw varchar2(1); --免打扰服务
v_qxyhfw varchar2(1); --缺席用户服务
v_nzfw varchar2(1); --闹钟服务
v_slbh varchar2(20); --受理编号
--t_dhhm varchar2(13); --临时电话号码
V_XDHHM VARCHAR2(8);
v_rowid varchar2(20);
v_ywlb varchar2(4);
v_slfs varchar2(4);
v_oldpsnum varchar2(15);
v_newpsid varchar2(11);
v_dxxfw varchar2(2);
v_misscall varchar2(1);
begin
open cur_znw;
loop
fetch cur_znw into v_slbh,v_ywlb,v_slfs ,v_rowid;
exit when cur_znw%NOTFOUND;
--01 用户放号
if (v_ywlb='FA11') --如果是新装机用户
then
begin
select dhhm,jqm into v_dhhm,v_psid from xlt_jqm where slbh=v_slbh ;
exception
when others then
begin
insert into dlb_znw_fault select * from dlb_znw where slbh=v_slbh ;
delete from dlb_znw where slbh=v_slbh;
commit;
CLOSE CUR_ZNW ;
return ;
end ;
end;
insert into adduser_interface@to_xlt (PSID ,PSNUM,PSIDFLAG,TOLLCODE ,CANUM,COMMANDTYPE, PRIORITY)
values (nvl(v_psid,'0000'),'86715'||v_dhhm ,'0', '715','咸宁','01',1);
--用户开通成功
select DECODE(SUBSTR(CKFWXM,1,2),'22','0','11','0','00','3','20','2','10','2','4') into v_hcxz from gdb_dh where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
insert into mododb_interface@to_xlt (PSNUM,SUBSTATE,BAROUT,BARIN,BARPRC,BARFWD,BARIP,BARSS ,BARAUTH,COMMANDTYPE ,PRIORITY)
values ('86715'||v_dhhm ,'1',v_hcxz,'0','0','0','0','0','0','05',2);
--向MODSS_INTERFACE表中插入数据
insert into modss_interface@to_xlt
(PSNUM,CLIP,CFU,CFB,CFNRY,CFNRC,CW,CH,FFI,ASS,ASNZ,SN,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,decode(substr(v_ckfwxm,17,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,4,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,24,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,7,1),'2','1','1','1',''),
'',decode(substr(v_ckfwxm,11,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,12,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,8,1),'2','1','1','1',''),'','06',2)
;
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,decode(substr(v_ckfwxm,26,1),'3','00','2','11','1','11','0','00','11'),'2','86710003000','0','1',sysdate,'08',4) ;
end if ;
--02 用户销户
if (v_ywlb='FA21')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into DELUSER_INTERFACE@to_xlt (PSNUM,COMMANDTYPE,PRIORITY )
values ('86715'||v_dhhm , '02',1);
--注销XLT_JQM中的数据
delete from xlt_jqm where dhhm=v_dhhm ;
end if ;
---数据修改完毕
--用户换PSID
if (v_ywlb='FA4M')
then
--处理过程
select oldpsnum,newpsid into v_oldpsnum,v_newpsid from dlb_znw where rowid=v_rowid;
insert into modpsid_interface@to_xlt (OLDPSNUM,NEWPSID,COMMANDTYPE,PRIORITY) values(v_oldpsnum , v_newpsid,'04',5);
-- UPDATE XLT_JQM SET JQM=V_NEWPSID WHERE DHHM=SUBSTR(V_OLDPSNUM,5,7);
-- 更改PSID的任务在程序中已经实现
end if ;
后面还有
#2
--03 修改用户状态(开通、欠费、报停等) 用户营业要求停机
--FA4H 停机保号
if (v_ywlb='FA4H')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'1','03',2);
end if ;
--FA4I 停机后复话
if (v_ywlb='FA4I')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'0','03',2);
end if ;
--04 用户换机(更换PSID) 前台换机
--用户换号
if (v_ywlb='FA55')
THEN
SELECT YDHHM ,XDHHM INTO V_DHHM, V_XDHHM FROM GDB_DH WHERE SLBH=V_SLBH ;
INSERT INTO MODPSNUM_INTERFACE@TO_XLT(OLDPSNUM,NEWPSNUM,COMMANDTYPE,PRIORITY )
VALUES ('86715'||v_dhhm,'86715'||V_Xdhhm,'07','05');
UPDATE XLT_JQM SET DHHM=V_XDHHM WHERE DHHM=V_DHHM;
END IF ;
--暂时不写
if (v_ywlb='FA42') --如果是增减程控服务用户
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
--05 修改ODB数据 长途限制和呼入限制
select decode(substr(v_ckfwxm,1,2),'13','2','33','3','30','3','12','0','20','2','22','0','5') into v_hcxz from dual ;
if v_hcxz!='5' then
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
--来电显示
select decode(substr(v_ckfwxm,17,1),'3','0','2','1','5') into v_ldxs from dual ;
if v_ldxs!='5' then
insert into modss_interface@to_xlt ( psnum ,clip,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ldxs,'06',2);
end if ;
--无条件转移
select decode(substr(v_ckfwxm,4,1),'3','0','2','1','5') into v_wtjzy from dual ;
if v_wtjzy!='5' then
insert into modss_interface@to_xlt (psnum,cfu,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wtjzy,'06',2);
end if ;
--遇忙转移
select decode(substr(v_ckfwxm,24,1),'3','0','2','1','5') into v_ymzy from dual ;
if v_ymzy!='5' then
insert into modss_interface@to_xlt (psnum,cfb,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ymzy,'06',2);
end if ;
--无应答转移
select decode(substr(v_ckfwxm,23,1),'3','0','2','1','5') into v_wydzy from dual ;
if v_wydzy!='5' then
insert into modss_interface@to_xlt (psnum,cfnry,cfnrc,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wydzy,v_wydzy,'06',2);
end if ;
--呼叫等待
select decode(substr(v_ckfwxm,7,1),'3','0','2','1','5') into v_hjdd from dual ;
if v_hjdd!='5' then
insert into modss_interface@to_xlt (psnum,cw,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_hjdd,'06',2);
end if ;
--免打扰服务
select decode(substr(v_ckfwxm,11,1),'3','0','2','1','5') into v_mdrfw from dual ;
if v_mdrfw!='5' then
insert into modss_interface@to_xlt (psnum,ffi,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_mdrfw,'06',2);
end if ;
--缺席用户服务
select decode(substr(v_ckfwxm,12,1) ,'3','0','2','1','5') into v_qxyhfw from dual ;
if v_qxyhfw!='5' then
insert into modss_interface@to_xlt (psnum,ass,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_qxyhfw,'06',2);
end if ;
--闹钟服务
select decode(substr(v_ckfwxm,8,1),'3','0','2','1','5') into v_nzfw from dual ;
if v_nzfw!='5' then
insert into modss_interface@to_xlt (psnum,asnz,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_nzfw,'06',2);
end if ;
--短信服务
select decode(substr(v_ckfwxm,26,1),'3','00','2','11','5') into v_dxxfw from dual ;
select decode(substr(v_ckfwxm,26,1),'3','0','2','0','0') into v_misscall from dual ;
if v_dxxfw!='5' then
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,v_dxxfw,'2','86710003000',v_misscall,'1',sysdate,'08',4) ;
end if ;
end if ;
--如果是其他业务
insert into dlb_znw_log select * from dlb_znw where rowid=v_rowid;
-- 处理掉dlb_znw 里面的数据
DELETE FROM dlb_znw where rowid=v_rowid;
--delete from dlb_znw where slbh=row_znw.SLbh and gdbh=row_znw.gdbh;
commit ;
end loop ;
close cur_znw;
COMMIT;
exception
when others then
begin
rollback;
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
--FA4H 停机保号
if (v_ywlb='FA4H')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'1','03',2);
end if ;
--FA4I 停机后复话
if (v_ywlb='FA4I')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'0','03',2);
end if ;
--04 用户换机(更换PSID) 前台换机
--用户换号
if (v_ywlb='FA55')
THEN
SELECT YDHHM ,XDHHM INTO V_DHHM, V_XDHHM FROM GDB_DH WHERE SLBH=V_SLBH ;
INSERT INTO MODPSNUM_INTERFACE@TO_XLT(OLDPSNUM,NEWPSNUM,COMMANDTYPE,PRIORITY )
VALUES ('86715'||v_dhhm,'86715'||V_Xdhhm,'07','05');
UPDATE XLT_JQM SET DHHM=V_XDHHM WHERE DHHM=V_DHHM;
END IF ;
--暂时不写
if (v_ywlb='FA42') --如果是增减程控服务用户
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
--05 修改ODB数据 长途限制和呼入限制
select decode(substr(v_ckfwxm,1,2),'13','2','33','3','30','3','12','0','20','2','22','0','5') into v_hcxz from dual ;
if v_hcxz!='5' then
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
--来电显示
select decode(substr(v_ckfwxm,17,1),'3','0','2','1','5') into v_ldxs from dual ;
if v_ldxs!='5' then
insert into modss_interface@to_xlt ( psnum ,clip,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ldxs,'06',2);
end if ;
--无条件转移
select decode(substr(v_ckfwxm,4,1),'3','0','2','1','5') into v_wtjzy from dual ;
if v_wtjzy!='5' then
insert into modss_interface@to_xlt (psnum,cfu,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wtjzy,'06',2);
end if ;
--遇忙转移
select decode(substr(v_ckfwxm,24,1),'3','0','2','1','5') into v_ymzy from dual ;
if v_ymzy!='5' then
insert into modss_interface@to_xlt (psnum,cfb,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ymzy,'06',2);
end if ;
--无应答转移
select decode(substr(v_ckfwxm,23,1),'3','0','2','1','5') into v_wydzy from dual ;
if v_wydzy!='5' then
insert into modss_interface@to_xlt (psnum,cfnry,cfnrc,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wydzy,v_wydzy,'06',2);
end if ;
--呼叫等待
select decode(substr(v_ckfwxm,7,1),'3','0','2','1','5') into v_hjdd from dual ;
if v_hjdd!='5' then
insert into modss_interface@to_xlt (psnum,cw,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_hjdd,'06',2);
end if ;
--免打扰服务
select decode(substr(v_ckfwxm,11,1),'3','0','2','1','5') into v_mdrfw from dual ;
if v_mdrfw!='5' then
insert into modss_interface@to_xlt (psnum,ffi,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_mdrfw,'06',2);
end if ;
--缺席用户服务
select decode(substr(v_ckfwxm,12,1) ,'3','0','2','1','5') into v_qxyhfw from dual ;
if v_qxyhfw!='5' then
insert into modss_interface@to_xlt (psnum,ass,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_qxyhfw,'06',2);
end if ;
--闹钟服务
select decode(substr(v_ckfwxm,8,1),'3','0','2','1','5') into v_nzfw from dual ;
if v_nzfw!='5' then
insert into modss_interface@to_xlt (psnum,asnz,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_nzfw,'06',2);
end if ;
--短信服务
select decode(substr(v_ckfwxm,26,1),'3','00','2','11','5') into v_dxxfw from dual ;
select decode(substr(v_ckfwxm,26,1),'3','0','2','0','0') into v_misscall from dual ;
if v_dxxfw!='5' then
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,v_dxxfw,'2','86710003000',v_misscall,'1',sysdate,'08',4) ;
end if ;
end if ;
--如果是其他业务
insert into dlb_znw_log select * from dlb_znw where rowid=v_rowid;
-- 处理掉dlb_znw 里面的数据
DELETE FROM dlb_znw where rowid=v_rowid;
--delete from dlb_znw where slbh=row_znw.SLbh and gdbh=row_znw.gdbh;
commit ;
end loop ;
close cur_znw;
COMMIT;
exception
when others then
begin
rollback;
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
#3
job也贴出来啊
#4
你的过程应该没有问题,是JOB调用时出错,、
不过你的过程怎么没有捕捉异常?还有异常处理呢?
不过你的过程怎么没有捕捉异常?还有异常处理呢?
#5
对,我觉得就是我的过程捕捉异常和异常处理有问题,请帮我看看。谢谢。
JOB中实际上没有什么,就是直接调用这个存储过程。
JOB中实际上没有什么,就是直接调用这个存储过程。
#6
格式按照这样写
begin
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
。。。。
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR( -20024, SQLERRM) ;
end;
BEGIN
select bwzx,bwzy INTO bwzx,bwzy from oa_pvt03 where bbh = bbbh and hxh = j ;
EXCEPTION
when no_data_found then
raise_application_error( -20563, '提示:归属定义出错: '||key||', 没有找到该行该列的报表数据数据,bbh='||TO_CHAR(bbbh)||',hxh='||TO_CHAR(j)||',lxh='||TO_CHAR(i)||'@' );
when others then
raise_application_error( -20564, sqlerrm );
END;
begin
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
。。。。
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR( -20024, SQLERRM) ;
end;
BEGIN
select bwzx,bwzy INTO bwzx,bwzy from oa_pvt03 where bbh = bbbh and hxh = j ;
EXCEPTION
when no_data_found then
raise_application_error( -20563, '提示:归属定义出错: '||key||', 没有找到该行该列的报表数据数据,bbh='||TO_CHAR(bbbh)||',hxh='||TO_CHAR(j)||',lxh='||TO_CHAR(i)||'@' );
when others then
raise_application_error( -20564, sqlerrm );
END;
#7
大哥,能不能把整个需要修改的地方都指出来修改一下。谢谢。
#8
http://community.csdn.net/Expert/topic/2918/2918709.xml?temp=.8689844
哇塞好長的問題呀!!!
哇塞好長的問題呀!!!
#9
ORA-02041 client database did not begin a transaction
Cause: An update occurred at a coordinated database without the coordinator
beginning a distributed transaction. This may happen if a stored procedure
commits and then performs updates, and the stored procedure is invoked
remotely. It could also happen if an external transaction monitor violates the XA
protocol.
Action: If the cause is the former, check that any commit is not followed by an
update.
check that any commit is not followed by an update.
樓主我幫你檢查了一下,在過程的最後有點問題
commit ;
end loop ;
close cur_znw;
COMMIT; --這兒
exception
when others then
begin
rollback; --這兒
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
你最好把過程執行按照LGQDUCKY(飘)的說法,將錯誤的對應程序段找出來
Cause: An update occurred at a coordinated database without the coordinator
beginning a distributed transaction. This may happen if a stored procedure
commits and then performs updates, and the stored procedure is invoked
remotely. It could also happen if an external transaction monitor violates the XA
protocol.
Action: If the cause is the former, check that any commit is not followed by an
update.
check that any commit is not followed by an update.
樓主我幫你檢查了一下,在過程的最後有點問題
commit ;
end loop ;
close cur_znw;
COMMIT; --這兒
exception
when others then
begin
rollback; --這兒
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
你最好把過程執行按照LGQDUCKY(飘)的說法,將錯誤的對應程序段找出來
#10
所有的都用异常处理,
#1
create or replace procedure yybh.pro_xlttoznw
as
cursor cur_znw is select a.slbh,a.ywlb,a.slfs, rowid from dlb_znw a ; --将队列表中的内容取出
v_ckfwxm varchar2(30) ; --程控服务项目
v_psid varchar2(20) ; --小灵通鉴权码
v_dhhm varchar2(8) ; -- 电话号码
v_ldxs varchar2(1); --来电显示
v_hcxz varchar2(1); --呼出限制
v_wtjzy varchar2(1); --无条件呼叫转移
v_ymzy varchar2(1); --遇忙转移
v_wydzy varchar2(1); --无应答转移
v_hjdd varchar2(1); --呼叫等待
v_mdrfw varchar2(1); --免打扰服务
v_qxyhfw varchar2(1); --缺席用户服务
v_nzfw varchar2(1); --闹钟服务
v_slbh varchar2(20); --受理编号
--t_dhhm varchar2(13); --临时电话号码
V_XDHHM VARCHAR2(8);
v_rowid varchar2(20);
v_ywlb varchar2(4);
v_slfs varchar2(4);
v_oldpsnum varchar2(15);
v_newpsid varchar2(11);
v_dxxfw varchar2(2);
v_misscall varchar2(1);
begin
open cur_znw;
loop
fetch cur_znw into v_slbh,v_ywlb,v_slfs ,v_rowid;
exit when cur_znw%NOTFOUND;
--01 用户放号
if (v_ywlb='FA11') --如果是新装机用户
then
begin
select dhhm,jqm into v_dhhm,v_psid from xlt_jqm where slbh=v_slbh ;
exception
when others then
begin
insert into dlb_znw_fault select * from dlb_znw where slbh=v_slbh ;
delete from dlb_znw where slbh=v_slbh;
commit;
CLOSE CUR_ZNW ;
return ;
end ;
end;
insert into adduser_interface@to_xlt (PSID ,PSNUM,PSIDFLAG,TOLLCODE ,CANUM,COMMANDTYPE, PRIORITY)
values (nvl(v_psid,'0000'),'86715'||v_dhhm ,'0', '715','咸宁','01',1);
--用户开通成功
select DECODE(SUBSTR(CKFWXM,1,2),'22','0','11','0','00','3','20','2','10','2','4') into v_hcxz from gdb_dh where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
insert into mododb_interface@to_xlt (PSNUM,SUBSTATE,BAROUT,BARIN,BARPRC,BARFWD,BARIP,BARSS ,BARAUTH,COMMANDTYPE ,PRIORITY)
values ('86715'||v_dhhm ,'1',v_hcxz,'0','0','0','0','0','0','05',2);
--向MODSS_INTERFACE表中插入数据
insert into modss_interface@to_xlt
(PSNUM,CLIP,CFU,CFB,CFNRY,CFNRC,CW,CH,FFI,ASS,ASNZ,SN,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,decode(substr(v_ckfwxm,17,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,4,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,24,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,7,1),'2','1','1','1',''),
'',decode(substr(v_ckfwxm,11,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,12,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,8,1),'2','1','1','1',''),'','06',2)
;
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,decode(substr(v_ckfwxm,26,1),'3','00','2','11','1','11','0','00','11'),'2','86710003000','0','1',sysdate,'08',4) ;
end if ;
--02 用户销户
if (v_ywlb='FA21')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into DELUSER_INTERFACE@to_xlt (PSNUM,COMMANDTYPE,PRIORITY )
values ('86715'||v_dhhm , '02',1);
--注销XLT_JQM中的数据
delete from xlt_jqm where dhhm=v_dhhm ;
end if ;
---数据修改完毕
--用户换PSID
if (v_ywlb='FA4M')
then
--处理过程
select oldpsnum,newpsid into v_oldpsnum,v_newpsid from dlb_znw where rowid=v_rowid;
insert into modpsid_interface@to_xlt (OLDPSNUM,NEWPSID,COMMANDTYPE,PRIORITY) values(v_oldpsnum , v_newpsid,'04',5);
-- UPDATE XLT_JQM SET JQM=V_NEWPSID WHERE DHHM=SUBSTR(V_OLDPSNUM,5,7);
-- 更改PSID的任务在程序中已经实现
end if ;
后面还有
as
cursor cur_znw is select a.slbh,a.ywlb,a.slfs, rowid from dlb_znw a ; --将队列表中的内容取出
v_ckfwxm varchar2(30) ; --程控服务项目
v_psid varchar2(20) ; --小灵通鉴权码
v_dhhm varchar2(8) ; -- 电话号码
v_ldxs varchar2(1); --来电显示
v_hcxz varchar2(1); --呼出限制
v_wtjzy varchar2(1); --无条件呼叫转移
v_ymzy varchar2(1); --遇忙转移
v_wydzy varchar2(1); --无应答转移
v_hjdd varchar2(1); --呼叫等待
v_mdrfw varchar2(1); --免打扰服务
v_qxyhfw varchar2(1); --缺席用户服务
v_nzfw varchar2(1); --闹钟服务
v_slbh varchar2(20); --受理编号
--t_dhhm varchar2(13); --临时电话号码
V_XDHHM VARCHAR2(8);
v_rowid varchar2(20);
v_ywlb varchar2(4);
v_slfs varchar2(4);
v_oldpsnum varchar2(15);
v_newpsid varchar2(11);
v_dxxfw varchar2(2);
v_misscall varchar2(1);
begin
open cur_znw;
loop
fetch cur_znw into v_slbh,v_ywlb,v_slfs ,v_rowid;
exit when cur_znw%NOTFOUND;
--01 用户放号
if (v_ywlb='FA11') --如果是新装机用户
then
begin
select dhhm,jqm into v_dhhm,v_psid from xlt_jqm where slbh=v_slbh ;
exception
when others then
begin
insert into dlb_znw_fault select * from dlb_znw where slbh=v_slbh ;
delete from dlb_znw where slbh=v_slbh;
commit;
CLOSE CUR_ZNW ;
return ;
end ;
end;
insert into adduser_interface@to_xlt (PSID ,PSNUM,PSIDFLAG,TOLLCODE ,CANUM,COMMANDTYPE, PRIORITY)
values (nvl(v_psid,'0000'),'86715'||v_dhhm ,'0', '715','咸宁','01',1);
--用户开通成功
select DECODE(SUBSTR(CKFWXM,1,2),'22','0','11','0','00','3','20','2','10','2','4') into v_hcxz from gdb_dh where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
insert into mododb_interface@to_xlt (PSNUM,SUBSTATE,BAROUT,BARIN,BARPRC,BARFWD,BARIP,BARSS ,BARAUTH,COMMANDTYPE ,PRIORITY)
values ('86715'||v_dhhm ,'1',v_hcxz,'0','0','0','0','0','0','05',2);
--向MODSS_INTERFACE表中插入数据
insert into modss_interface@to_xlt
(PSNUM,CLIP,CFU,CFB,CFNRY,CFNRC,CW,CH,FFI,ASS,ASNZ,SN,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,decode(substr(v_ckfwxm,17,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,4,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,24,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1',''),
decode(substr(v_ckfwxm,23,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,7,1),'2','1','1','1',''),
'',decode(substr(v_ckfwxm,11,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,12,1),'2','1','1','1','')
,decode(substr(v_ckfwxm,8,1),'2','1','1','1',''),'','06',2)
;
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,decode(substr(v_ckfwxm,26,1),'3','00','2','11','1','11','0','00','11'),'2','86710003000','0','1',sysdate,'08',4) ;
end if ;
--02 用户销户
if (v_ywlb='FA21')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into DELUSER_INTERFACE@to_xlt (PSNUM,COMMANDTYPE,PRIORITY )
values ('86715'||v_dhhm , '02',1);
--注销XLT_JQM中的数据
delete from xlt_jqm where dhhm=v_dhhm ;
end if ;
---数据修改完毕
--用户换PSID
if (v_ywlb='FA4M')
then
--处理过程
select oldpsnum,newpsid into v_oldpsnum,v_newpsid from dlb_znw where rowid=v_rowid;
insert into modpsid_interface@to_xlt (OLDPSNUM,NEWPSID,COMMANDTYPE,PRIORITY) values(v_oldpsnum , v_newpsid,'04',5);
-- UPDATE XLT_JQM SET JQM=V_NEWPSID WHERE DHHM=SUBSTR(V_OLDPSNUM,5,7);
-- 更改PSID的任务在程序中已经实现
end if ;
后面还有
#2
--03 修改用户状态(开通、欠费、报停等) 用户营业要求停机
--FA4H 停机保号
if (v_ywlb='FA4H')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'1','03',2);
end if ;
--FA4I 停机后复话
if (v_ywlb='FA4I')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'0','03',2);
end if ;
--04 用户换机(更换PSID) 前台换机
--用户换号
if (v_ywlb='FA55')
THEN
SELECT YDHHM ,XDHHM INTO V_DHHM, V_XDHHM FROM GDB_DH WHERE SLBH=V_SLBH ;
INSERT INTO MODPSNUM_INTERFACE@TO_XLT(OLDPSNUM,NEWPSNUM,COMMANDTYPE,PRIORITY )
VALUES ('86715'||v_dhhm,'86715'||V_Xdhhm,'07','05');
UPDATE XLT_JQM SET DHHM=V_XDHHM WHERE DHHM=V_DHHM;
END IF ;
--暂时不写
if (v_ywlb='FA42') --如果是增减程控服务用户
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
--05 修改ODB数据 长途限制和呼入限制
select decode(substr(v_ckfwxm,1,2),'13','2','33','3','30','3','12','0','20','2','22','0','5') into v_hcxz from dual ;
if v_hcxz!='5' then
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
--来电显示
select decode(substr(v_ckfwxm,17,1),'3','0','2','1','5') into v_ldxs from dual ;
if v_ldxs!='5' then
insert into modss_interface@to_xlt ( psnum ,clip,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ldxs,'06',2);
end if ;
--无条件转移
select decode(substr(v_ckfwxm,4,1),'3','0','2','1','5') into v_wtjzy from dual ;
if v_wtjzy!='5' then
insert into modss_interface@to_xlt (psnum,cfu,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wtjzy,'06',2);
end if ;
--遇忙转移
select decode(substr(v_ckfwxm,24,1),'3','0','2','1','5') into v_ymzy from dual ;
if v_ymzy!='5' then
insert into modss_interface@to_xlt (psnum,cfb,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ymzy,'06',2);
end if ;
--无应答转移
select decode(substr(v_ckfwxm,23,1),'3','0','2','1','5') into v_wydzy from dual ;
if v_wydzy!='5' then
insert into modss_interface@to_xlt (psnum,cfnry,cfnrc,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wydzy,v_wydzy,'06',2);
end if ;
--呼叫等待
select decode(substr(v_ckfwxm,7,1),'3','0','2','1','5') into v_hjdd from dual ;
if v_hjdd!='5' then
insert into modss_interface@to_xlt (psnum,cw,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_hjdd,'06',2);
end if ;
--免打扰服务
select decode(substr(v_ckfwxm,11,1),'3','0','2','1','5') into v_mdrfw from dual ;
if v_mdrfw!='5' then
insert into modss_interface@to_xlt (psnum,ffi,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_mdrfw,'06',2);
end if ;
--缺席用户服务
select decode(substr(v_ckfwxm,12,1) ,'3','0','2','1','5') into v_qxyhfw from dual ;
if v_qxyhfw!='5' then
insert into modss_interface@to_xlt (psnum,ass,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_qxyhfw,'06',2);
end if ;
--闹钟服务
select decode(substr(v_ckfwxm,8,1),'3','0','2','1','5') into v_nzfw from dual ;
if v_nzfw!='5' then
insert into modss_interface@to_xlt (psnum,asnz,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_nzfw,'06',2);
end if ;
--短信服务
select decode(substr(v_ckfwxm,26,1),'3','00','2','11','5') into v_dxxfw from dual ;
select decode(substr(v_ckfwxm,26,1),'3','0','2','0','0') into v_misscall from dual ;
if v_dxxfw!='5' then
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,v_dxxfw,'2','86710003000',v_misscall,'1',sysdate,'08',4) ;
end if ;
end if ;
--如果是其他业务
insert into dlb_znw_log select * from dlb_znw where rowid=v_rowid;
-- 处理掉dlb_znw 里面的数据
DELETE FROM dlb_znw where rowid=v_rowid;
--delete from dlb_znw where slbh=row_znw.SLbh and gdbh=row_znw.gdbh;
commit ;
end loop ;
close cur_znw;
COMMIT;
exception
when others then
begin
rollback;
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
--FA4H 停机保号
if (v_ywlb='FA4H')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'1','03',2);
end if ;
--FA4I 停机后复话
if (v_ywlb='FA4I')
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
insert into MODFLAG_INTERFACE@to_xlt (psnum,newflag,commandtype,priority)
values ('86715'||v_dhhm ,'0','03',2);
end if ;
--04 用户换机(更换PSID) 前台换机
--用户换号
if (v_ywlb='FA55')
THEN
SELECT YDHHM ,XDHHM INTO V_DHHM, V_XDHHM FROM GDB_DH WHERE SLBH=V_SLBH ;
INSERT INTO MODPSNUM_INTERFACE@TO_XLT(OLDPSNUM,NEWPSNUM,COMMANDTYPE,PRIORITY )
VALUES ('86715'||v_dhhm,'86715'||V_Xdhhm,'07','05');
UPDATE XLT_JQM SET DHHM=V_XDHHM WHERE DHHM=V_DHHM;
END IF ;
--暂时不写
if (v_ywlb='FA42') --如果是增减程控服务用户
then
select Ydhhm into v_dhhm from GDB_DH where slbh=v_slbh ;
select ckfwxm into v_ckfwxm from gdb_dh where slbh=v_slbh ;
--05 修改ODB数据 长途限制和呼入限制
select decode(substr(v_ckfwxm,1,2),'13','2','33','3','30','3','12','0','20','2','22','0','5') into v_hcxz from dual ;
if v_hcxz!='5' then
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
--来电显示
select decode(substr(v_ckfwxm,17,1),'3','0','2','1','5') into v_ldxs from dual ;
if v_ldxs!='5' then
insert into modss_interface@to_xlt ( psnum ,clip,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ldxs,'06',2);
end if ;
--无条件转移
select decode(substr(v_ckfwxm,4,1),'3','0','2','1','5') into v_wtjzy from dual ;
if v_wtjzy!='5' then
insert into modss_interface@to_xlt (psnum,cfu,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wtjzy,'06',2);
end if ;
--遇忙转移
select decode(substr(v_ckfwxm,24,1),'3','0','2','1','5') into v_ymzy from dual ;
if v_ymzy!='5' then
insert into modss_interface@to_xlt (psnum,cfb,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_ymzy,'06',2);
end if ;
--无应答转移
select decode(substr(v_ckfwxm,23,1),'3','0','2','1','5') into v_wydzy from dual ;
if v_wydzy!='5' then
insert into modss_interface@to_xlt (psnum,cfnry,cfnrc,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_wydzy,v_wydzy,'06',2);
end if ;
--呼叫等待
select decode(substr(v_ckfwxm,7,1),'3','0','2','1','5') into v_hjdd from dual ;
if v_hjdd!='5' then
insert into modss_interface@to_xlt (psnum,cw,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_hjdd,'06',2);
end if ;
--免打扰服务
select decode(substr(v_ckfwxm,11,1),'3','0','2','1','5') into v_mdrfw from dual ;
if v_mdrfw!='5' then
insert into modss_interface@to_xlt (psnum,ffi,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_mdrfw,'06',2);
end if ;
--缺席用户服务
select decode(substr(v_ckfwxm,12,1) ,'3','0','2','1','5') into v_qxyhfw from dual ;
if v_qxyhfw!='5' then
insert into modss_interface@to_xlt (psnum,ass,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_qxyhfw,'06',2);
end if ;
--闹钟服务
select decode(substr(v_ckfwxm,8,1),'3','0','2','1','5') into v_nzfw from dual ;
if v_nzfw!='5' then
insert into modss_interface@to_xlt (psnum,asnz,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,v_nzfw,'06',2);
end if ;
--短信服务
select decode(substr(v_ckfwxm,26,1),'3','00','2','11','5') into v_dxxfw from dual ;
select decode(substr(v_ckfwxm,26,1),'3','0','2','0','0') into v_misscall from dual ;
if v_dxxfw!='5' then
INSERT INTO MODTEL_INTERFACE@TO_XLT(PSNUM,SPEECH,SM,SMTYPE,SCADDR,MISSCALL,MISSCALLTYPE,WRITEDATE,COMMANDTYPE,PRIORITY)
values ('86715'||v_dhhm,'11' ,v_dxxfw,'2','86710003000',v_misscall,'1',sysdate,'08',4) ;
end if ;
end if ;
--如果是其他业务
insert into dlb_znw_log select * from dlb_znw where rowid=v_rowid;
-- 处理掉dlb_znw 里面的数据
DELETE FROM dlb_znw where rowid=v_rowid;
--delete from dlb_znw where slbh=row_znw.SLbh and gdbh=row_znw.gdbh;
commit ;
end loop ;
close cur_znw;
COMMIT;
exception
when others then
begin
rollback;
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
#3
job也贴出来啊
#4
你的过程应该没有问题,是JOB调用时出错,、
不过你的过程怎么没有捕捉异常?还有异常处理呢?
不过你的过程怎么没有捕捉异常?还有异常处理呢?
#5
对,我觉得就是我的过程捕捉异常和异常处理有问题,请帮我看看。谢谢。
JOB中实际上没有什么,就是直接调用这个存储过程。
JOB中实际上没有什么,就是直接调用这个存储过程。
#6
格式按照这样写
begin
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
。。。。
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR( -20024, SQLERRM) ;
end;
BEGIN
select bwzx,bwzy INTO bwzx,bwzy from oa_pvt03 where bbh = bbbh and hxh = j ;
EXCEPTION
when no_data_found then
raise_application_error( -20563, '提示:归属定义出错: '||key||', 没有找到该行该列的报表数据数据,bbh='||TO_CHAR(bbbh)||',hxh='||TO_CHAR(j)||',lxh='||TO_CHAR(i)||'@' );
when others then
raise_application_error( -20564, sqlerrm );
END;
begin
insert into mododb_interface@to_xlt (PSNUM,BAROUT,COMMANDTYPE, BARAUTH,PRIORITY)
values ('86715'||v_dhhm,v_hcxz,'05','0',2);
end if ;
。。。。
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR( -20024, SQLERRM) ;
end;
BEGIN
select bwzx,bwzy INTO bwzx,bwzy from oa_pvt03 where bbh = bbbh and hxh = j ;
EXCEPTION
when no_data_found then
raise_application_error( -20563, '提示:归属定义出错: '||key||', 没有找到该行该列的报表数据数据,bbh='||TO_CHAR(bbbh)||',hxh='||TO_CHAR(j)||',lxh='||TO_CHAR(i)||'@' );
when others then
raise_application_error( -20564, sqlerrm );
END;
#7
大哥,能不能把整个需要修改的地方都指出来修改一下。谢谢。
#8
http://community.csdn.net/Expert/topic/2918/2918709.xml?temp=.8689844
哇塞好長的問題呀!!!
哇塞好長的問題呀!!!
#9
ORA-02041 client database did not begin a transaction
Cause: An update occurred at a coordinated database without the coordinator
beginning a distributed transaction. This may happen if a stored procedure
commits and then performs updates, and the stored procedure is invoked
remotely. It could also happen if an external transaction monitor violates the XA
protocol.
Action: If the cause is the former, check that any commit is not followed by an
update.
check that any commit is not followed by an update.
樓主我幫你檢查了一下,在過程的最後有點問題
commit ;
end loop ;
close cur_znw;
COMMIT; --這兒
exception
when others then
begin
rollback; --這兒
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
你最好把過程執行按照LGQDUCKY(飘)的說法,將錯誤的對應程序段找出來
Cause: An update occurred at a coordinated database without the coordinator
beginning a distributed transaction. This may happen if a stored procedure
commits and then performs updates, and the stored procedure is invoked
remotely. It could also happen if an external transaction monitor violates the XA
protocol.
Action: If the cause is the former, check that any commit is not followed by an
update.
check that any commit is not followed by an update.
樓主我幫你檢查了一下,在過程的最後有點問題
commit ;
end loop ;
close cur_znw;
COMMIT; --這兒
exception
when others then
begin
rollback; --這兒
close CUR_ZNW ;
return ;
end ;
end pro_xlttoznw ;
你最好把過程執行按照LGQDUCKY(飘)的說法,將錯誤的對應程序段找出來
#10
所有的都用异常处理,