overloading of stored procedure is possible in oracle?
Answer Posted / 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 View All Answers
List different type of expressions with the example.
How to rename a column in the output of sql query?
Why having clause is used in sql?
How can a pl sql block be executed?
How do I partition a table in sql?
What is difference between joins and union?
what is sub-query? : Transact sql
What is sql used for?
how many sql ddl commands are supported by 'mysql'? : Sql dba
What is the difference between the sql*loader and import utilities? : aql loader
How to revise and re-run the last sql command?
What is substitution variable in pl sql?
What is dml and ddl?
What is forward declaration in pl sql?
Is sql a scripting language?