0

My Oracle 存储过程不返回任何结果。我已经在 SPROC 之外测试了查询,它似乎返回了值。我感觉这与我传递样本和测试参数的方式有关 - 因为如果我在存储过程中硬编码 sampleNumber 和 testNumber 参数,结果会正确返回。我已经粘贴了过程和 PLSQL 声明。我对编写 Oracle 程序非常陌生,任何帮助都将不胜感激。谢谢你。

    CREATE OR REPLACE PROCEDURE TESTANALYSIS
    (vOrderNumber IN VARCHAR2
    , vTestNumber IN NUMBER
    , vSampleNumber IN NUMBER
    ) 

    AS

    anVar VARCHAR2(50) := NULL;

    BEGIN

    SELECT T.ANALYSIS INTO anVar FROM TEST T JOIN SAMPLE S
    ON T.SAMPLE_NUMBER = S.SAMPLE_NUMBER
    WHERE T.TEST_NUMBER = vTestNumber
    AND S.SAMPLE_NUMBER = vSampleNumber
    AND S.ORDER_NUM = vOrderNumber;

    dbms_output.put_line(anVar);

    END TESTANALYSIS;


    --PL SQL Call 
    SET SERVEROUTPUT ON
    EXEC TESTANALYSIS('4200010061', 720000050516, 14789)
    /
4

0 回答 0