overloading of stored procedure is possible in oracle?

Answers were Sorted based on User's Feedback



overloading of stored procedure is possible in oracle?..

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

overloading of stored procedure is possible in oracle?..

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

overloading of stored procedure is possible in oracle?..

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

Post New Answer

More SQL PLSQL Interview Questions

What are the return values of functions SQLCODE and SQLERRM ?

2 Answers   PreVator,


Does varchar need length?

0 Answers  


what is cursor procedure

1 Answers   iGate,


What is right join sql?

0 Answers  


I have a tablle like this. cust acc --------------- a 1 b 2|3 c 4|5|6 I Want below o/p: cust acc ----------- a 1 b 2 b 3 c 4 c 5 c 6 Please any one can you have any ideas share me. I have urgent requirement.

4 Answers   Cap Gemini, MTS,






What is the Diff b/w Constraints and Trigeer

4 Answers   HCL,


Table Order_Name has a column Order_Date which gives the date & Time at which the order is passed.Find the table to write a query to find out the latest order.

5 Answers   Thomson,


How do you truncate?

0 Answers  


What are the different dml commands in sql?

0 Answers  


Can I call a procedure inside a function?

0 Answers  


What is difference between function and trigger?

0 Answers  


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

0 Answers  


Categories