PLSQL Local and Global Variable
Global Variable:- Global variable is variable that is declared in the outermost block and available for all inner blocks.
Local Variable: -Local variable are variables those are declared in inner block and available for only that inner block
Local Variable: -Local variable are variables those are declared in inner block and available for only that inner block
declare
a number;
b number; --Global variable
sum1 number;
begin
a:=&a;
b:=&b;
sum1:=a+b;
dbms_output.put_line('Sum of given numbers is :'||sum1);
declare
b number; --Local variable
begin
dbms_output.put_line('Sum of given numbers is :'||b);
end;
dbms_output.put_line('Sum of given numbers is :'||a);
end;
/
1 comments:
nice article bro
Post a Comment