·  PLSQL – Syntax – Conditionals – if...else

 

- Info:

  - This tutorial shows how to use if conditional statements.

 

- Procedure:

  - Create "PL/SQL Application" Test.sql.

 

    Test.sql

    DECLARE

      value NUMBER;

      text  VARCHAR2(10);

    

    BEGIN

    

      value := 10;

      text  := 'bird';

    

      IF    (value = 10    ) THEN DBMS_OUTPUT.PUT_LINE ('Value = 10'    );

      ELSIF (text  = 'bird') THEN DBMS_OUTPUT.PUT_LINE ('Text is bird'  );

      ELSE                        DBMS_OUTPUT.PUT_LINE ('No match found');

      END IF;

      

    END;