Oracle Variables -

Oracle allows variables to be defined in several places -

  Substitution
SQL*Plus
Host/Bind
SQL*Plus or other Host Program
PL/SQL
Stored Procedure
Where to use For passing values into an SQL script. For passing values out of a PL/SQL block Used only within a PL/SQL block
How to initialise and assign DEFINE
ACCEPT
&&
&

VARIABLE

:g_char :=

DECLARE

:=
Prefix & : none
How to Examine DEFINE var_name PRINT DBMS_OUTPUT.put_line
or assign to a bind variable
or simply write values into a table.
       


Related commands

If you are using Java stored procedures then you can add Java variables to the above.
defined as:

datatype variable_name;

where datatype is: string, char, boolean, byte, short, int, long, float, double, or a class variable.

 

Back to the Top

Simon Sheppard
SS64.com