PL/SQL is block-based.
The PL/SQL block structure is as follows: declare .... begin .... exception .... end; variable Declaration: declare X varchar2 (400); begin X: = 'this is .... ';
Dbms_output.put_line ('x value: '| X ); 2
End 3
; 4
/Note the semicolon. End.
In dos, no information is output by default. You can use serveroutput on size 1000; size.
The size in the buffer zone. The maximum value is 1 million. At this time, the execution of '/' will print... this is a simple execution process of PL/SQL blocks. Here, dbmsoutput is a package provided by the system and a tool for external interaction. PL/SQL ProgramBefore the end, sqlplus does not retrieve any display data from the buffer. Example: declare X varchar2 (400): = 'abc'; y INTEGER: = 123; begin X: = 'this is .... '; Y: = 1; dbms_output.put_line ('x value:' | X); dbms_output.put_line ('y value: '| y ); End ; SQL> @ F: \ plsql01.txt; /Execute print: the value of X: this is... the value of Y: 1