1.

What is the %FOUND and %NOTFOUND cursor attributes in PL/SQL?

Answer»

To display output, PL/SQL has an in-built package known as DBMS_OUTPUT. With this package, we can also display debugging information.

The following is an example:

DECLARE    one varchar2(20) := 'Website';    two varchar2(20) := ' World!'; BEGIN    dbms_output.put_line(one || two); END; /

The output:

Website World!

Let us see the subprograms of DBMS_OUTPUT:

  • DBMS_OUTPUT.DISABLE; 

Disables message output.

  • DBMS_OUTPUT.ENABLE(buffer_size IN INTEGER DEFAULT 20000);

Enables message output. A NULL value of buffer_size represents unlimited buffer size.

  • DBMS_OUTPUT.GET_LINE (LINE OUT VARCHAR2, status OUT INTEGER);

Retrieves a SINGLE line of buffered information.

  • DBMS_OUTPUT.GET_LINES (lines OUT CHARARR, numlines IN OUT INTEGER);

Retrieves an array of lines from the buffer.

  • DBMS_OUTPUT.NEW_LINE;

Puts an end-of-line marker.

  • DBMS_OUTPUT.PUT(item IN VARCHAR2);

Places a PARTIAL line in the buffer.

  • DBMS_OUTPUT.PUT_LINE(item IN VARCHAR2);

Places a line in the buffer.



Discussion

No Comment Found