【发布时间】:2017-05-08 14:01:47
【问题描述】:
我创建了两个表,album 和 personnage,第三个包含引用但它返回此错误:
警告:过程创建时出现编译错误。
有什么问题。?怎么解决。?
CREATE OR REPLACE PROCEDURE TT1_AJOUTE_PERSON_DANS_ALBUM(pnump in number , pnuma in number)
--paramètres à préciser
IS
v_pers number;
v_alb number;
BEGIN
select count(a.numa) into v_alb
from tt1_album a
where (a.numa=pnuma);
if(v_alb=0) then
dbms_output.put_line('album introuvable');
end if;
select count(p.nump) into v_pers
from tt1_peronnage p
where (p.nump=pnump);
if(v_pers=0) then
dbms_output.put_line('personnage introuvable');
end if;
if(v_pers=1 and v_alb=1 ) then
insert into tt1_abl_pers values((select ref(a) from tt1_album a
where(a.numa=pnuma));
(select ref(p) from tt1_personnage p where(p.nump=pnump)));
end if;
END ;
/
当我运行命令显示错误时,它返回
【问题讨论】:
-
你定义函数
ref()了吗? -
是的,定义不正确
-
在 SQL*Plus 中运行
SHOW ERRORS命令以显示错误。 -
在最后的 'END IF' 之前有一个无效行。看不出它的意图是什么。看起来它应该是插入的一部分。
-
请看它提到的行号。你有一个分号而不是插入的逗号。正如消息所暗示的那样。
标签: sql oracle stored-procedures