Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Recursive Function

RE: Recursive Function

From: Carel-Jan Engel <cjpengel.dbalert_at_xs4all.nl>
Date: Sun, 09 May 2004 22:05:58 +0200
Message-Id: <6.0.1.1.0.20040509215154.43e2a060@pop.xs4all.nl>


At 09:48 PM 5/9/2004, you wrote:
>Inline comments >>
>
> >> I'm older; I started with machine-language. Makes me a trochlodyte?
Probably, I'm not that good in history/archeology/paleontology! apologies

> >> To check means more CPU time, so more wall-time, so less performance??
>But those days switching of boundary checks in the (USCD-P) compiler caused
>a significant gain in performance.

Boundary checking (this was Pascal), means that the compiler had to generate additional code to test at runtime that copy operations in arrays didn't try to write outside of the arrys. (Something that 'C' has 'switched off' by default ;-) ). So, after running our (extensive) tests, we switched this of for production. We went even further: declaring a set of parameters in a certain order meant that they were stored on the stack in that order. Disabling type-checking, and passing the address of the first parameter to a procedure or function that had the same set of parameters declared (in the same order!) saved pushing extra pointers on the stack. Just the first address was passed, and the rest was derived automatically. Saved some additional time at runtime. We did this at extremely low-level functions. Forgive me that I do not recall the exact syntax.

> >>>> How would you pass these values 'back'?? Some global variables (in a
>pkg?, something like this?)

No, call by reference means that the parameter used in the function actually uses the same address space as the variable that was passed to the function at calling time. So the value is 'back' already when the procedure/function ends. But, from the perspective of the procedure the variables are within the scope of the procedure.

> >>>> If you don't have an error, what error-codes would you put back. And in
>reverse: if you got an error, what function value would you give back?

Like in 'C': 0 is OK, every non-zero value is a predefined error situation.

>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.
>
> >>That may be old fashioned. But it works flawlessly. The first time I wrote
>some Oracle code I did it like this and I heard that I was old fashioned. I
>didn't give a ...

Amen!

>Of course raising exceptions is the mechanism for
>that now, so my way of working might be somewhat old-fashioned. Unskyld.

Regards, Carel-Jan

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



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Sun May 09 2004 - 15:04:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US