x

What is Over Loading and what are its restrictions ?

Can anybody explain me briefly what is the Overloading in PL/SQL and please let me know if any restrictions of this in Oracle. Thank you.

more ▼

asked Jan 07 '10 at 10:48 AM in Default

OracleApprender gravatar image

OracleApprender
771 68 73 75

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Overloading of Procedures is discussed here:

Oracle Docs - Procedures

Briefly, it's a way of assigning two different kinds of operation to a single procedure name, depending on the type or number of values passed. You could create a procedure, PLUS, that had two different implementations, depending on what was passed. PLUS can be a reasonable operation for both strings and numbers but would probably work in two different ways...

PLUS (1, 1) yields 2, an arithmetic addition.

PLUS ('1','1') yields '11', a concatenation.

The restrictions are discussed on that page and there's a good example or two.

more ▼

answered Jan 10 '10 at 11:24 PM

KillerDBA gravatar image

KillerDBA
1.5k 8 9 10

(comments are locked)
10|1200 characters needed characters left

You can find a great example in DBMS_OUTPUT. You'll see an overloaded procedure called 'GET_LINES'. I think the only restriction is that each overloaded object must have a unique set of input params.

Packages - Module Overloading Module Overloading

more ▼

answered Jan 07 '10 at 11:03 AM

HillbillyToad gravatar image

HillbillyToad
1k 2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x375
x50

asked: Jan 07 '10 at 10:48 AM

Seen: 778 times

Last Updated: Jan 07 '10 at 10:48 AM