Re: Passing values between procedures(without actually passing them)

From: Tim X <timx_at_nospam.dev.null>
Date: Sat, 30 Jan 2010 14:43:54 +1100
Message-ID: <87k4v0uuit.fsf_at_lion.rapttech.com.au>



LPF <eng.lpsff_at_gmail.com> writes:

> It's possible to achieve something like this?
>
> Procedure1(param1,param2) IS
> ...
> begin
> Procedure2;
> end Procedure1;
>
> Procedure2 IS
> ....
> begin
> --Know the parameters values of Procedure1 at this point(with
> dbms_debug, dbms_trace, some V$, ....)
> end Procedure2;
>
> The point to this is that i have a lot of procedures(like Procedure1)
> calling a Procedure(Procedure2).
> So if this could be achieved, i only have to use a simple line like
> "Procedure2;" to all procedures(and with the advantage of not being
> dependent of the number of parameteres, so future changes wouldn't
> affect the Procedure2 call).
>

DO NOT DO IT! this is such a bad idea on so many levels, I can't even begin to list them all. I also doubt it will work technically and even if it did, you are likely to be in all sorts of mess when the oracle version changes. essentialy, you may as well code your whole thing as one huge procedure because doing it how you suggest would be about the same. You would lose all the benefits of scoping, would rely on side effects, would run itno all sorts of type issues, would cripple system efficiency and wuld create a monster that cannot be maintained or easily tested.

Programmers should be lazy, but not that lazy. Use decent tools and the changes your talking about are not a problem. In fact, they are a benefit as you can make changes and easily identify and test what has been modified and you only need to understand the bit of code your changing, not the whole system with its hidden side effects.

Tim

-- 
tcross (at) rapttech dot com dot au
Received on Fri Jan 29 2010 - 21:43:54 CST

Original text of this message