Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
警告:创建过程时出现编译错误sql3_Sql_Oracle_Stored Procedures - Fatal编程技术网

警告:创建过程时出现编译错误sql3

警告:创建过程时出现编译错误sql3,sql,oracle,stored-procedures,Sql,Oracle,Stored Procedures,我创建了两个表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.nu

我创建了两个表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 ;
 /

当我运行commnd show errors时,它返回的错误是由以下代码引起的:

插入tt1\u abl\u pers值从tt1\u相册a中选择重构 其中,numa=pnuma;从tt1_人员管理p中选择refp 其中p.nump=pnump

我假设您要将函数结果[refa和refp]的值插入表tt1\u abl\u pers:

INSERT INTO tt1_abl_pers
(ref)
SELECT ref(a) FROM tt1_album a WHERE(a.numa=pnuma)
UNION ALL
SELECT ref(p ) FROM tt1_personnage p WHERE(p.nump=pnump);

您定义了函数ref吗?是的,我将定义在SQL*Plus中运行SHOW ERRORS命令来显示错误。在最后的“END IF”之前有一行无效。真的看不出它的意图是什么。看起来它是插入的一部分。请看它提到的行号。插入时使用分号而不是逗号。正如信息所暗示的那样。