2

我在 Oracle 18c 中有这个非常简单的过程,编译得很好

 CREATE OR REPLACE PROCEDURE quera_vcelar
(v_cislo_ula IN INFORMACIE_ULOV.cislo_ula%TYPE,
v_meno        OUT VARCHAR2,
v_bydlisko    OUT UDAJE_VCELAROV.bydlisko%TYPE)
IS
BEGIN
    SELECT meno || ' ' || priezvisko,bydlisko
        INTO v_meno,v_bydlisko
    FROM UDAJE_VCELAROV uv JOIN INFORMACIE_ULOV iu ON(uv.cislo_ula = iu.cislo_ula)
    WHERE iu.cislo_ula = v_cislo_ula;
END quera_vcelar;
/

但是在我初始化变量并尝试运行它之后

VARIABLE p_meno VARCHAR2(30)
VARIABLE p_bydlisko VARCHAR2(20)
EXECUTE quera_vcelar(10, :p_meno :p_bydlisko);
PRINT p_meno p_bydlisko;

我收到这个错误

Error starting at line : 17 in command -
BEGIN quera_vcelar(10, :p_meno :p_bydlisko); END;
Error report -
ORA-06550: line 1, column 42:
PLS-00103: Encountered the symbol "SQLDEVBIND1Z_1" when expecting one of the following:

   . ( ) , * @ % & = - + < / > at in is mod remainder not rem =>
   <an exponent (**)> <> or != or ~= >= <= <> and or like like2
   like4 likec between || multiset member submultiset
The symbol "." was substituted for "SQLDEVBIND1Z_1" to continue.
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

可悲的是,我在任何地方都找不到任何答案。

4

1 回答 1

1

我认为您的程序调用中只缺少一个逗号。

EXECUTE quera_vcelar(10, :p_meno  :p_bydlisko)  -- wrong
EXECUTE quera_vcelar(10, :p_meno, :p_bydlisko)  -- correct

很可能有人会关闭您的问题,因为这只是一个错字。我希望它会保持开放一段时间,因为我发现“SQLDEVBIND1Z_1”有点令人毛骨悚然(正如@Barbados 也注意到的那样)。这似乎是保护文字的 SQLcl 功能,但我需要阅读更多内容,因为我以前从未见过它。

于 2020-05-02T12:48:52.410 回答