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, 2010 at 10:48 AM in Default

avatar image

771 73 75 79

(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, 2010 at 11:24 PM

avatar image

1.5k 9 11 14

(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, 2010 at 11:03 AM

avatar image

1k 2 4

(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.

Follow this question

By Email:

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



Answers and Comments

SQL Server Central

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



asked: Jan 07, 2010 at 10:48 AM

Seen: 1898 times

Last Updated: Jan 07, 2010 at 10:48 AM

Copyright 2018 Redgate Software. Privacy Policy