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.
On
please note a syntax bellow for pl/sql block
declare
-- you can declare variable here like
v_name varchar2(50); -- declaration of variable
v_app_name varchar2(10):= 'oracle_app'; -- declaration and definition of veriable
begin
-- business logic goes here...
--exception section....
end;
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
DECLAREstarts a pl/sql block.DEFINEsubstitute values.Regarding
VARIABLEtake a look on Oracle Documentation.