Re: Help! Stored functions

From: Ron Harvey <rbharvey_at_worldnet.att.net>
Date: Wed, 17 Jun 1998 21:54:03 -0600
Message-ID: <35889073.0_at_news2.uswest.net>


Hi.
Your syntax is wrong. Try the following. Notice no semi-colon after the return.

create function myfunc()
return number AS
temp number;
Begin
select into temp count(*) from SYS.MYTABLE; return temp;
End;

Michael Bennett wrote in message
<6m6k7o$5r9$1_at_mendelevium.btinternet.com>...
>When trying to compile the following function
>
>create function myfunc() AS
>return number;
>temp number;
>Begin
>select into temp count(*) from SYS.MYTABLE;
>return temp;
>End;
>
>The compilation fails with the message SYS.MYTABLE must be declared. The
>table is a valid one (which I have pre created) and any one line SELECT
>statements from the table on the SQLplus command prompt are performed
>succesfully.
>
>Can anyone please tell me how I can include this and other pre created
>tables in my stored procedures and functions?
>
>Thanks
>
>Paul
>
>
Received on Thu Jun 18 1998 - 05:54:03 CEST

Original text of this message