RE: Recursive Function

  • From: Carel-Jan Engel <cjpengel.dbalert@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Sun, 09 May 2004 21:24:48 +0200

Jared,

 From an old 'C' and Pascal programming dinosaur:

While I was working in an R&D department two decades ago, coding low-level 
IO-functions on proprietary databases and SW-development tools, I learned 
that passing variables 'by reference' (in/out in PL/SQL) was cheaper, 
because the value didn't need to be pushed on the stack, but just a 
referring pointer, which was less bytes most of the times. But those days 
switching of boundary checks in the (USCD-P) compiler caused a significant 
gain in performance.

What I particularly like to do is passing results (error-codes) back 
through the function, whilst the result of the function itself is passed 
through the variables. Of course raising exceptions is the mechanism for 
that now, so my way of working might be somewhat old-fashioned. Unskyld.

However, when I've got some spare time I would like to test whether passing 
by reference is cheaper in PL/SQL as well, especially when using huge 
variables to a procedure and/or function. Of course this depends on the 
calling mechanism that Oracle implemented in its PL/SQL engine. Maybe some 
insider, e.g. Steve Adams, can disclose a clue about this?

Regards, Carel-Jan

===
If you think education is expensive, try ignorance. (Derek Bok)
===


At 06:36 PM 5/9/2004, you wrote:
>On Sun, 2004-05-09 at 07:12, Jamadagni, Rajendra wrote:
> > In oracle functions you can have in/out parameters to a Function ... It
> > is perfectly legal, but we are not *taught* that way ... That is the
> > problem. No one *teaches* us to "think outside the box".
> >
>
>I've considered using in/out from a function, but
>then used a procedure instead.
>
>The idea of using a function to both return a value
>and modify its arguments seems like it would cause
>difficulty in following program flow.
>
>Maybe I just haven't encountered a situation where
>using this functionality would save the day.
>
>At the current rate with Sarbanes Oxley to greet
>me every day, I may never get the opportunity to
>find out.  At least it feels that way by Friday.
>
>Jared
>
>
>
>
>----------------------------------------------------------------
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>----------------------------------------------------------------
>To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
>put 'unsubscribe' in the subject line.
>--
>Archives are at //www.freelists.org/archives/oracle-l/
>FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
>-----------------------------------------------------------------

===
If you think education is expensive, try ignorance. (Derek Bok)
===

DBA!ert, Independent Oracle Consultancy
Kastanjelaan 61C
2743 BX  Waddinxveen
The Netherlands
tel.    +31 (0) 182 640 428
fax     +31 (0) 182 640 429
mobile  +31 (0) 653 911 950
e-mail info.dbalert@xxxxxxxxx




----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: