🔹 Join the OracleApps88 Telegram Group - Stay up to date with the latest on Oracle EBS R12 and Oracle Cloud/Fusion Applications. 📌 Telegram Group : https://t.me/OracleApps88

💡 Facing issues copying code/scripts or viewing posts? We're here to help!
📬 Contact on Telegram : https://t.me/apps88
📱 Telegram/WhatsApp: +91 905 957 4321
📧 Email Support: OracleApp88@Yahoo.com

Thursday, March 15, 2012

PL/SQL Parametrized Function example


 create or replace function vma_find_area
 (l in number ,w in number default 30)
 return number
 as
 a number;
 begin
 a:=w*l;
 return a;
 end;

-- Different ways to call--
declare

a number :=0;
begin
a:=vma_find_area(10,10);--Positional notations/parameters
dbms_output.put_line('The product is ...'||a);

a:=vma_find_area(w=>20,l=>10);--named notations/parameters here order is not imp
dbms_output.put_line('The product is ...'||a);

a:=vma_find_area(20,w=>20);--Mixed notations/parameters here order is important first positional and then Named.
dbms_output.put_line('The product is ...'||a);

a:=vma_find_area(l=>10);--Default notations/parameters
dbms_output.put_line('The product is ...'||a);

end;
/

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect