存储过程执行错误
CREATE OR REPLACE PROCEDURE ProcedureCount1
IS
CURSOR curpeson IS SELECT * FROM temp_ehr_count;
pesonid VARCHAR2(100);
BEGIN
FOR r IN curpeson LOOP
dbms_output.put_line(r.单位编号);
(一下select是出错的地方,实在找不到哪错了!)
select p.PK_PSNBASDOC into pesonid from BD_PSNBASDOC@EHR p , BD_PSNDOC@EHR ps
where p.PSNNAME = r.姓名 and ps.PK_CORP = r.单位编号 and p.PK_PSNBASDOC = ps.PK_PSNBASDOC;
-- update temp_ehr_count t set t.编号 = pesonid where t.姓名 = r.姓名;
end loop;
commit;
end ProcedureCount1;
begin
ProcedureCount1;
end;
------解决方案--------------------是不是select关连查询出来的值是多条呢?如果是多条into pesonid 是会有问题的.