Re: How Can I know that a parameter is missing inside a PL/SQL procedure or function?

From: Larry <xxxjavacne_at_hotmail.com>
Date: Sat, 23 Feb 2002 16:25:16 +0800
Message-ID: <a57jla$iqq1_at_imsp212.netvigator.com>


In this case I don't see any solution to your problem unless you are allowed to modify the procedure coding.

That's the way the default is working if you don't pass in all the parameters then it initializes to what you have TOLD them is appropriate when you designed you procedure.

I can think of unless you modify your defaults to some sentinel values which is not legal in your application. eg, number default -99. So, you can check each one inside you procedure.

As you pointed out you can't change the code, good luck.

"Dong" <dong.wang_at_core.ca> wrote in message news:772ee5fa.0202120848.e513578_at_posting.google.com...
> Hello everybody,
>
> Happy Chinese New year! (The year of horse)
>
> Right now I'm in the following situation and got lost:
>
> create or replace procedure PROC(
> c1 number default 0,
> c2 number default 0,
> c3 number default 0) is
> begin
> ...
> end;
> /
>
> Then I can call PROC by some different ways:
>
> (1) SQL> EXEC PROC(0, 0, 3)
> (2) SQL> EXEC PROC(c3 => 3)
>
> My question is, how can I know that there are 2 parameters (c1, c2)
> missing in (2) and the 0s actually come from their default values? As
> far as I knnow, there is no difference between (1) and (2) if we check
> the parameters from within the procedure PROC.
>
> Unfortunately, I'm not allowed to change the list of formal
> parameters, use any indicator variables or define any particular
> default values.
>
> Any help would be extremely appreciated :)
>
> Regards,
> Dong
Received on Sat Feb 23 2002 - 09:25:16 CET

Original text of this message