Re: HELP : PL/SQL SPEED Functions

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: Mon, 23 Aug 1999 18:40:09 GMT
Message-ID: <dAgw3.118$tS.3725_at_nntp.csufresno.edu>


In article <7prj17$s8g$1_at_pan.ipb.pt>, Joao Ricardo B Oliveira <jricardo_at_ipb.pt> wrote:
> I've created a function to get the description of a product, by
> entering the ID... this function is used several times by al the
> application... > I've speed problems, when in my application (FORMS
> 4.5) invoke the function for example :
>
> :order.description:=func_get_description(:order.ID)
>
> If i write the function code in the POST_CHANGE trigger is MUCH
> FASTER than invoking the function. Shouldnt be the opposite ?
>
>------------------------------------------
> the function have the follow code:
>
> function func_get_description(xid number)
> return char
> desc varchar2(80)
> begin
> select description into desc
> from prod
> where id=xid;
> exception
> when no_data_found then
> return('Not Found');
> end func_get_description;
>------------------------------------------

I assume your actual function has a RETURN before the exception.

There should be no difference in speed, if you table is small or you have a primary key on id. The speed problem is probably due to some other situation, perhaps a full-table scan in a post-query trigger.

Steve Cosner



http://members.aol.com/stevec5088
Downloadable Quick Access utility form: Display and update any table. Received on Mon Aug 23 1999 - 20:40:09 CEST

Original text of this message