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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Function Question

Re: Function Question

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 13 Mar 2000 20:06:27 -0000
Message-ID: <952978263.13850.2.nnrp-07.9e984b29@news.demon.co.uk>

You may find variations in different versions of Oracle. For one thing the calculation will only take place for rows meeting the 'date-field' predicate. For another, with 8.1 you could declare the function to be deterministic.

You might also try:-

    select distinct id_field, date_field, calc_field from     (
    Select ID_Field, Date_Field, FOO(ID_Field, Date_Field) calc_field     From Table
    Where Date_Field > To_Date('01-JAN-99', 'DD-MON-YY')     )
    AND calc_field > 0;

One option to check what's happening is to put a tell-tale SQL in the function, and turn on SQL_TRACE.

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Moore wrote in message ...
>Greetings!
>
>In the following will function foo be called twice per tupple?
>
>Select Distinct ID_Field, Date_Field, FOO(ID_Field, Date_Field)
>From Table
>Where Date_Field > To_Date('01-JAN-99', 'DD-MON-YY')
>AND FOO(ID_Field, Date_Field) > 0;
>
>By the way I already attempted:
>
>Select Distinct ID_Field, Date_Field, FOO(ID_Field, Date_Field) Foo_Field
>From Table
>Where Date_Field > To_Date('01-JAN-99', 'DD-MON-YY')
>AND Foo_Field > 0;
>
>Also attempted AS Foo_Field and "Foo Field".
>
>TIA
>
Received on Mon Mar 13 2000 - 14:06:27 CST

Original text of this message

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