Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: association operator (=>) and SQL
Hi chaim,
> We're working with an overloaded Oracle supplied function.
maybe a wrapper function could be a solution for the problem, see example below.
Regards,
Jaromir D.B. Nemec
Package created.
SQL> CREATE or replace PACKAGE BODY p IS
2 FUNCTION foo (arg1 varchar2) RETURN varchar2 IS BEGIN RETURN 'Hello
arg1'; END;
3 FUNCTION foo (arg2 varchar2) RETURN varchar2 IS BEGIN RETURN 'Hello
arg2'; END;
4 END;
5 /
Package body created.
SQL> -- this fails
SQL> select p.foo(0) from dual;
select p.foo(0) from dual
*
ERROR at line 1:
ORA-06553: PLS-307: too many declarations of 'FOO' match this call
SQL> --
SQL> create or replace function wrap(a varchar2, b varchar2) return varchar
2 is
3 begin
4 if b is null
5 then return p.foo(arg1=>a);
6 else return p.foo(arg2=>b); end if;
7 end;
8 /
Function created.
SQL> -- but this is OK
SQL> select wrap(NULL,'x') from dual;
WRAP(NULL,'X')
SQL> select wrap('x',NULL) from dual;
WRAP('X',NULL)
-- http://www.freelists.org/webpage/oracle-lReceived on Sun Apr 17 2005 - 14:00:48 CDT
![]() |
![]() |