PL SQL block for start : Program Block « PL SQL « Oracle PL / SQL






PL SQL block for start


SQL>
SQL> -- start PL SQL block
SQL>
SQL>
SQL> set serveroutput on
SQL> declare
  2    l_number number := 1;
  3  begin
  4    l_number := 1 + 1;
  5    dbms_output.put_line( '1 + 1 = ' || to_char( l_number ) || '!' );
  6  exception
  7    when others then
  8      dbms_output.put_line( 'We encountered an exception!' );
  9  end;
 10  /
1 + 1 = 2!

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL>
           
       








Related examples in the same category

1.Anonymous block with error handling
2.Basic PL/SQL program block
3.Variable scope in different program block