What is Overloading of procedures ?

The Same procedure name is repeated with parameters of different datatypes and  parameters  in  different  positions,  varying number of parameters is called overloading of procedures. e.g. DBMS_OUTPUT put_line What is a package ? What are the advantages of packages ?

Showing Answers 1 - 13 of 13 Answers

Sagar

  • Dec 6th, 2005
 

Overloading procs are 2 or more procs with the same name but different arguments.

Arguments needs to be different by class it self. ie char and Varchar2 are from same class.

Packages -

The main advantages of packages are -

1- Since packages has specification and body separate so, whenever any ddl is run and if any proc/func(inside pack) is dependent on that, only body gets invalidated and not the spec. So any other proc/func dependent on package does not gets invalidated.

2- Whenever any func/proc from package is called, whole package is loaded into memory and hence all objects of pack is availaible in memory which means faster execution if any is called. And since we put all related proc/func in one package this feature is useful as we may need to run most of the objects.

30 we can declare global variables in the package

  Was this answer useful?  Yes

baskar

  • Apr 11th, 2007
 

Package is a schema object that groups logically related? PL/SQL types, items and subprograms. Basically contains two parts namely specification and body.

Advantages

Modularity
Easier application design
Hiding information
Added functionality
Better performance
Overloading

  Was this answer useful?  Yes

idonknowyou

  • May 22nd, 2007
 

2 or more procedures or functions are called overloaded when

a) They have the same names
b) Different no of formal parameters defined
c) Formal parameters differ in their datatypes/Subtypes and not in the same family
d) They belong to same subprogram/package/PL SQL Block


They are not overloaded when

a) Any of the above points are not satisfied
b) RETURN datatype alone differs and not the formal parameters

The main purpose of overloading procedures is that, when a PL SQL block is found to do a same operation with different inputs, we names them same and feed different parameters

g_sidhu

  • Jan 31st, 2008
 

Overloading: Multiple subprograms of the same name

• Enables you to use the same name for different subprograms inside a PL/SQL block, a subprogram, or a package

• Requires the formal parameters of the subprograms to differ in number, order, or data type family

• Enables you to build more flexibility because a user or application is not restricted by the specific data type or number of formal parameters

Note: Only local or packaged subprograms can be overloaded. You cannot overload stand-alone subprograms.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions