在运行存储过程时,我一直会遇到这个执行错误。它应该从表1中选择一些值到几个变量中,使用使用db链接的select中的值,并从该链接的db表2中获取一个值,然后更新第一个表。
错误执行(1: 2):ORA-01403:没有数据找到ORA-06512: at "ASSGN_OF_ID",行24 ORA-06512:在第1行。
CREATE OR REPLACE PROCEDURE ASSGN_OF_ID
IS
v_transID varchar2 (30);
v_person_id NUMBER (12);
v_long_id NVARCHAR2 (15);
v_tranactions_date date;
v_assgn_id varchar2 (30);
v_t_emp_id varchar2 (30);
BEGIN
select max(transID) into v_transID from tranactions;
--
select personid, tranactionsdtm into v_person_id, v_tranactions_date
from tranactions
where transID = v_transID;
--
select lirrnum into v_long_id
from ptsadmin.person
where personid = v_person_id;
--
select emp_mstr_id into v_t_emp_id
from wok.emp_mstr@T_DBLINK
where emp_nbr = v_long_id;
--
select asgn_id into v_assgn_id
from wok.slip_mstr@T_DBLINK
where emp_mstr_id = v_t_emp_id
and trunc(v_tranactions_date) = trunc(eff_date_time);
--
update tranactions set t_asgn_id = v_assgn_id where transID = v_transID;
--
COMMIT;
END;它会在这条线上被阻止
select emp_mstr_id into v_t_emp_id
from wok.emp_mstr@T_DBLINK
where emp_nbr = v_long_id;如果前面的行运行,如果我用预定义的值运行语句,我看不出数据是如何运行的。
发布于 2019-11-29 14:47:36
DBMS_OUTPUT.PUT_LINE()告诉我出了什么问题,愚蠢的我,谢谢大家
https://stackoverflow.com/questions/59061553
复制相似问题