Plz any one explain functionoverloading and data hiding in oracle ?
same as objects concepts in oracle?..plz
Printable View
Plz any one explain functionoverloading and data hiding in oracle ?
same as objects concepts in oracle?..plz
Overloading functions are two or more functions with the same name but different arguments. You can use the same name for different functions if their formal parameters differ in number, order, or data type. For example in oracle you can define two functions with the same name as follows ex:- create or replace function amount_to_words (p_amt in number) return varchar2 is
create or replace function amount_to_words(p_amt in number, p_currency in varchar2)
return varchar2 is
packages provide a method of encapsulating related procedures, functions, and associated cursors and variables together as a unit in the database.
[QUOTE=krishnaindia2007;26115]Overloading functions are two or more functions with the same name but different arguments. You can use the same name for different functions if their formal parameters differ in number, order, or data type. For example in oracle you can define two functions with the same name as follows ex:- create or replace function amount_to_words (p_amt in number) return varchar2 is
create or replace function amount_to_words(p_amt in number, p_currency in varchar2)
return varchar2 is
packages provide a method of encapsulating related procedures, functions, and associated cursors and variables together as a unit in the database.[/QUOTE]
thanx..but kindly inform is dbms_output.put_line is an example of overloading?..thanx in advance
In overloading there should be difference in number of parameters or their data type or order of parameters. But dbms_output.put_line always takes only one parameter of type varchar2. You may pass different literals as parameter but it takes only one parameter of type varchar2 always. So dbms_output.put_line is not an example of overloading.