2011-11-22 OUT 参数

来源:这里教程网 时间:2026-03-03 14:43:17 作者:

http://www.itpub.net/thread-1499223-18-1.html 172楼 我创建了下面这个过程:

CREATE OR REPLACE PROCEDURE plch_proc (
   number_in    IN     NUMBER
, string_out      OUT VARCHAR2)
IS
BEGIN
   IF number_in > 0
   THEN
      string_out := TO_CHAR (number_in);
   END IF;
END;
/

然后我执行了这个块:

DECLARE
   l_string   VARCHAR2 (10);
BEGIN
   DBMS_OUTPUT.put_line ('String='||l_string);
   plch_proc (1, l_string);
   DBMS_OUTPUT.put_line ('String='||l_string);
   plch_proc (-1, l_string);
   DBMS_OUTPUT.put_line ('String='||l_string);
END;
/

我的屏幕上会看到什么输出?(A)

String=
String=1
String=1

(B)

String=
String=1
String=

(C)

String=
String=
String=1

(D)

Unhandled exception:
ORA-01503: OUT argument not assigned value

答案B

相关推荐

热文推荐