overloading of stored procedure is possible in oracle?
Answers were Sorted based on User's Feedback
Answer / neeraj siddhey
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.
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / monika
No, Only packaged procedures and procedures exists in
pl/sql blocks can be overloaded.Stored procedures can't.
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / vipin kumar
This is how its works
create or replace package vips_test as
function addition(a1 in number, b in number, c1 in number default 0) return number;
function addition(a1 in number, b in number ,d1 in number default 0) return number;
end;
/
show errors;
create or replace package body vips_test as
function addition(a1 in number, b in number, c1 in number default 0)
return number is
begin
dbms_output.put_line('---------------1----------------------');
return a1+b+c1;
end;
function addition(a1 in number, b in number ,d1 in number default 0)
return number is
begin
dbms_output.put_line('---------------2----------------------');
return a1+b+d1;
end;
end;
/
show errors;
select vips_test.addition(a1 => 1 ,b =>2, c1 => 2) from dual;
but if you will try calling as above
select vips_test.addition(a1 => 1 ,b =>2) from dual;
SQL Error: ORA-06553: PLS-307: too many declarations of 'ADDITION' match this call
06553. 00000 - "PLS-%s: %s"
| Is This Answer Correct ? | 3 Yes | 3 No |
what are the advantages of cursors than procedures?
What is the difference between function and procedure in pl/sql?
Why is pl sql needed?
What is normalization and types of normalization?
22 Answers Etisbew, F-TEC, Microsoft, TechProcess,
When the mutating error will comes? and how it will be resolved?
What are the advantages of indexing?
What are triggers and its uses?
What is character functions?
What is %s in sql?
what is sp_pkeys? : Transact sql
What is the use of %rowtype?
types of exceptions and what is meant by pragma autonomous_transaction ?what is the use.
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)