Variable command: define a variable : Variable « PL SQL « Oracle PL / SQL






Variable command: define a variable


SQL>
SQL>
SQL> -- Print command
SQL>
SQL>
SQL> VARIABLE g_result VARCHAR2(100)
SQL> BEGIN
  2     :g_result :='Hello';
  3  END;
  4  /

PL/SQL procedure successfully completed.

SQL>
SQL> PRINT g_result

G_RESULT
-------------------
Hello

SQL>
SQL>

           
       








Related examples in the same category

1.Use VARIABLE command to define variable
2.Define variable and use it in SQL statement in PL/SQL
3.Use block name to reference a variable name