我的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)
/