Concatenate string and number : DBMS_OUTPUT « PL SQL « Oracle PL / SQL






Concatenate string and number

 
SQL>
SQL> set serveroutput on
SQL> declare
  2    myNumber number := 1;
  3  begin
  4    myNumber := 1 + 1;
  5    dbms_output.put_line( '1 + 1 = ' || to_char( myNumber ) || '!' );
  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>

 








Related examples in the same category

1.Print out value using DBMS_OUTPUT.PUT_LINE
2.DBMS_OUTPUT package
3.Use dbms_output.put_line to display varchar2 type value