java 提取违反顺序_oracle 中 java.sql.SQLException: ORA-01002: 提取违反顺序

在一个流程中设置了一个机器人节点,目的是:审批结束后,通过update语句,将表单中的一些内容更新到数据库person_info_t的表中,并将更新前后的值记录到新表info_update_record中。机...

在一个流程中设置了一个机器人节点,目的是:审批结束后,通过update语句,将表单中的一些内容更新到数据库person_info_t的表中,并将更新前后的值记录到新表info_update_record中。机器人节点中的sql语句,冒号开头表示变量

update person_info_t set fd_work_phone_ext=:workphoneext, fd_mobile_no_office=:mobilenooffice, pad_mac=:mac , computer_name=:computer,tmp_type=1 where fd_login_name=:uname;

--tmp_type=0或者=1是记录数据来源,因为update可能来自两种操作,流程是一种,通讯录更新是另外一种,通讯录更新时,不会更新tmp_type的值

Person_info_t 部分字段:

在person_info_t的表中,创建了一个trigger,当发生update时,触发,语句如下:

create or replace trigger mac_update_trig

before update or insert

on person_info_t

for each row

when ( new.pad_mac <> old.pad_mac or new.computer_name <> old.computer_name or new.fd_work_phone_ext <> old.fd_work_phone_ext or new.fd_mobile_no_office <> old.fd_mobile_no_office )

declare

pre varchar2(50);

aft varchar2(50);

date_now date := sysdate;

uname varchar2(50);

Begin

--对于不同的update,对info_update_record进行insert,分别记录

uname := :old.fd_login_name;

if (:new.pad_mac <> :old.pad_mac) then

pre := :old.pad_mac;

aft := :new.pad_mac;

insert into info_update_record

values

(uname, date_now, 'pad_mac', pre, aft, :new.tmp_type);

end if;

if (:new.computer_name <> :old.computer_name) then

pre := :old.computer_name;

aft := :new.computer_name;

insert into info_update_record

values

(uname, date_now, '计算机名', pre, aft, :new.tmp_type);

end if;

if (:new.fd_work_phone_ext <> :old.fd_work_phone_ext) then

pre := :old.fd_work_phone_ext;

aft := :new.fd_work_phone_ext;

insert into info_update_record

values

(uname, date_now, '分机号码', pre, aft, :new.tmp_type);

end if;

if (:new.fd_mobile_no_office <> :old.fd_mobile_no_office) then

pre := :old.fd_mobile_no_office;

aft := :new.fd_mobile_no_office;

insert into info_update_record

values

(uname, date_now, '集团号', pre, aft, :new.tmp_type);

end if;

--重置tmp_type值为0

:new.tmp_type := 0;

end;

info_update_record 全部字段:

报错部分:

java.sql.SQLException: ORA-01002: 提取违反顺序

以上update直接在plsql下操作是可以通过的,例如

update person_info_t set pad_mac ='123456789',tmp_type=1 where fd_login_name='guoxing_lu'

问题挺揪心的,弄个好几天了,求大侠帮助

展开


版权声明:本文为weixin_29702195原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。