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
Can we join tables without foreign key?
Are pl sql variables case sensitive?
what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba
How can triggers be used for the table auditing?
How to add a column ‘salary’ to a table employee_details?
How do you exit in sql?
What is the meaning of disabling a trigger?
What is procedure function?
Can you load data into multiple tables at once? : aql loader
what is the difference between join and union? : Sql dba
How do I run a sql trace?
What is a loop in sql?
Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
Describe types of sql statements?