Oracle PL/SQL/PL SQL/Output Print

Материал из SQL эксперт
Перейти к: навигация, поиск

Concate values before output

SQL>
SQL> --  Your first FOR loop.
SQL> set echo on
SQL> BEGIN
  2       FOR i IN 1..5 LOOP
  3            DBMS_OUTPUT.PUT_LINE("Loop counter is " || i);
  4       END LOOP;
  5  END;
  6  /
Loop counter is 1
Loop counter is 2
Loop counter is 3
Loop counter is 4
Loop counter is 5
PL/SQL procedure successfully completed.



Print and output values

SQL>
SQL> --The basic four arithmetic operators in action.
SQL> SET SERVEROUTPUT ON
SQL> BEGIN
  2     DBMS_OUTPUT.PUT_LINE(4 * 2);  --Multiplication
  3     DBMS_OUTPUT.PUT_LINE(24 / 3); --Division
  4     DBMS_OUTPUT.PUT_LINE(4 + 4);  --Addition
  5     DBMS_OUTPUT.PUT_LINE(16 - 8); --Subtraction
  6  END;
  7  /
8
8
8
8
PL/SQL procedure successfully completed.
SQL>