Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Overloading package functions
"Rastko Potocnik" <ratislav.potocnik_at_guest.arnes.si> wrote in message
news:uCRS5.10$6Z.545_at_news.siol.net...
> I want to overload a function in PL/SQL package wich returns
>
> 1.) 0 or SQLCODE on error and free (not existing) object name as output
> parameter
> 2.) free object name or NULL on error
>
> The package is compiled successfully but when I call function I get
> PLS-00307 error (too many declarations of func_name match this call.
>
> Should I declare overloading in some way and if yes, how?
>
> declaration in packagespec:
>
> FUNCTION TMP_OBJECT_NAME
> (object_name OUT VARCHAR2, prefix IN VARCHAR2 := '') RETURN
NUMBER;
>
> FUNCTION TMP_OBJECT_NAME
> (prefix IN VARCHAR2 := '') RETURN VARCHAR2;
>
> package body code:
>
> FUNCTION TMP_OBJECT_NAME(object_name OUT VARCHAR2, prefix IN VARCHAR2 :=
'')
> RETURN NUMBER IS
>
> i_ret NUMBER;
> v_name USER_OBJECTS.OBJECT_NAME%TYPE;
> BEGIN
> i_ret := priv_TMP_OBJECT_NAME(v_name, prefix);
> if i_ret = 0 then
> object_name := v_name;
> end if;
> RETURN i_ret;
> EXCEPTION
> WHEN OTHERS THEN RETURN SQLCODE;
> END;
>
> FUNCTION TMP_OBJECT_NAME(prefix IN VARCHAR2 := '')
> RETURN VARCHAR2 IS
>
> i_ret NUMBER;
> v_name USER_OBJECTS.OBJECT_NAME%TYPE;
> BEGIN
> i_ret := priv_TMP_OBJECT_NAME(v_name, prefix);
> if i_ret = 0 then
> RETURN v_name;
> else
> RETURN NULL;
> end if;
> EXCEPTION
> WHEN OTHERS THEN RETURN NULL;
> END;
>
> --
> Rastko Potocnik
> rastko.potocnik_at_rtvslo.si
>
>
>
>
Looks like your problem is the number of arguments isn't identical.
Hth,
Sybrand Bakker, Oracle DBA Received on Wed Nov 22 2000 - 12:18:39 CST
![]() |
![]() |