i am new to PL/SQL. I am confused with the difference between following.
DECLARE name Varchar2(20);
VARIABLE name Varchar2(20);
DEFINE name = 'myname';
Thanks in advance.
DECLARE
starts a pl/sql block.
DEFINE
substitute values.
Regarding VARIABLE
take a look on Oracle Documentation.
please note a syntax bellow for pl/sql block
declare : start of pl/sql block.
variable : is name of variable used for storing intermediate/computation value.
Define : The DEFINE and UNDEFINE commands allow you to explicitly create and delete user variables. DEFINE creates a variable and assigns it an initial value. DEFINE also lets you list all currently defined user variables with their values. these are mainly used in sql script; eg to store table_space name which can be used for creating table