Results 1 to 4 of 4

Thread: Function overloading and data encapsulation

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    5

    Function overloading and data encapsulation

    Plz any one explain functionoverloading and data hiding in oracle ?
    same as objects concepts in oracle?..plz


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Function overloading and data encapsulation

    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.


  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    5

    Re: Function overloading and data encapsulation

    Quote Originally Posted by krishnaindia2007 View Post
    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.
    thanx..but kindly inform is dbms_output.put_line is an example of overloading?..thanx in advance


  4. #4
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Function overloading and data encapsulation

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact