CREATE OR REPLACE PROCEDURE Orden (n1 IN number, n2 IN number, n3 IN number) AS
menor number;
mediano number;
mayor number;
BEGIN
IF (n1<n2) THEN
IF (n1<n3) THEN
menor := n1;
IF (n2<n3) THEN
mediano := n2;
mayor := n3;
ELSE
mediano := n3;
mayor := n2;
END IF;
ELSE
menor := n3;
mediano :=n1;
mayor := n2;
END IF;
ELSE
IF (n1 < n3) THEN
menor := n2;
mediano := n1;
mayor := n3;
ELSE
mayor := n1;
IF(n2< n3) THEN
medio := n2;
menor := n3;
ELSE
medio := n3;
menor := n2;
END IF;
END IF;
n1 := menor;
n2 := medio;
n3 := mayor;
END;
/
错误是下一个:
39/5 PLS-00103:遇到符号“;”当期待其中一个 该 以下: 如果
答案 0 :(得分:1)
三个问题:
END IF
medio
永远不会被宣布;也许你的意思是mediano
?IN OUT
。提示:CASE
可能是实现相同逻辑的更易读的方式。