ELSIF V / S ELSE IF IN ORACLE

what is the difference between the two.

elsif

else if

while both run fine without errors.

+8
source share
2 answers

ELSIF does not need an appropriate END IF. If the condition for the 1st drive is not fulfilled, then the ELSIF condition is checked.

ELSE IF will need an appropriate END IF because a new IF block is starting.

References

PL / SQL Control Statements in the Oracle® PL / SQL Database Language Reference

+9
source

The statement IFin PL / SQL is structured as

IF <<some condition>>
THEN
  <<do something>>
ELSIF <<another condition>>
THEN
  <<do something else>>
ELSE
  <<do a third thing>>
END IF;

ELSIF ELSE . ELSE IF, , - IF ( END IF) ELSE.

IF <<some condition>>
THEN
  <<do something>>
ELSE
  IF <<another condition>>
  THEN
    <<do something else>>
  END IF;
END IF;

, , PL/SQL , . , , , . IF , , , , IF ELSIF (, , CASE). , END IF, IF.

+12

Source: https://habr.com/ru/post/1535799/


All Articles