您好,登錄后才能下訂單哦!
http://www.itpub.net/thread-1499223-12-1.html
113樓
下面的選項都實現了這個過程:
CREATE OR REPLACE PROCEDURE plch_show_lowest ( number1_in IN NUMBER , number2_in IN NUMBER , number3_in IN NUMBER) IS
哪一種能夠顯示傳入的三個數中最小的一個?假設傳給plch_show_lowest的實際值都不為空。
(A)
BEGIN DBMS_OUTPUT.put_line ( LEAST (number1_in, LEAST (number2_in, number3_in))); END;
(B)
BEGIN DBMS_OUTPUT.put_line ( SMALLEST (number1_in, number2_in, number3_in)); END;
(C)
BEGIN DBMS_OUTPUT.put_line ( MIN (number1_in, number2_in, number3_in)); END;
(D)
l_lowest NUMBER; BEGIN SELECT LEAST (number1_in, number2_in, number3_in) INTO l_lowest FROM DUAL; DBMS_OUTPUT.put_line (l_lowest); END;
(E)
l_lowest NUMBER := number1_in; BEGIN IF number2_in < l_lowest THEN l_lowest := number2_in; END IF; IF number3_in < l_lowest THEN l_lowest := number3_in; END IF; DBMS_OUTPUT.put_line (l_lowest); END;
(F)
BEGIN DBMS_OUTPUT.put_line ( LEAST (number1_in, number2_in, number3_in)); END;
實測
B報錯 PLS-00201: 必須聲明標識符 'SMALLEST'
C報錯 PLS-00103: 出現符號 ")"在需要下列之一時: := . ( % ; 符號 "(" 被替換為 ")" 后繼續。
ADEF均正確
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。