1.

What is DBMS_OUTPUT package in PL/SQL

Answer»

At each iteration in a BASIC loop in PL/SQL, sequence of statements is executed. After the execution, the control resumes at the top of the loop. The EXIT STATEMENT is a must in the execution part to exit from the loop. The keyword LOOP begins the execution. It ENDS with the keyword END LOOP.

The following is an example:

DECLARE   a number := 2; BEGIN   LOOP      dbms_output.put_line(a);      a := a + 2;      IF a > 10 THEN         exit;      END IF;   END LOOP;   dbms_output.put_line('After exit, the value of a = ' || a); END; /

The output:

2 4 6 8 10 After exit, the value of a = 12


Discussion

No Comment Found