Re: ORACLE*FORMS and stored functions

From: Singapore Airlines Ltd <engsys_at_merlion.singnet.com.sg>
Date: 1996/08/06
Message-ID: <4u6f7a$34p_at_lantana.singnet.com.sg>#1/1


Hello there,

we can use a stored function in a SQL stmt provided it is in a package and if you want to use it the function should not do any updations to the database.

the package creation script may look like this...

create package my_pack is

    function compute(....) return ....;
    pragma restrict_references(COMPUTE, WNPS, WNDS); end my_pack;

I heard, this is to say this function does not update any tables.

Hope this helps.
Prasad.
Steve Cosner (stevec_at_zimmer.CSUFresno.EDU) wrote:
: In article <DvI9xB.MGF_at_news.cern.ch>,
: Maria SKIADELLI <msk_at_afsmail.cern.ch> wrote:
: >I have a function created from SQL*PLUS. I use this function normally from
: >PROC*C applications. I tried to call this function from a procedure created in
: >forms 4.5. I get back an error saying that the function cannot be
: used in SQL.
 

: You didn't give the SQL code you were trying or the error message,
: so I may not understand the problem correctly. But I think it may be:
 

: You cannot use a stored function in a select statement. The
: following will fail:
 

: Select MyFunct(col1),col2 from MyTable;
 

: Instead, you should do something like
: Declare C1 number,C2 number,Temp varchar2(40);
: Begin
: Select col1,col2 from MyTable into C1,C2;
: Temp := MyFunct(C1);
: End;
 

: Note how the function was called outside of the Select statement.
 

: Hope this helps.
: Steve Cosner
:
  Received on Tue Aug 06 1996 - 00:00:00 CEST

Original text of this message