Re: Turning Form30 Procedures into Functions???
Date: 12 Mar 93 16:05:09 +1100
Message-ID: <1993Mar12.160509.672_at_hhcs.gov.au>
In article <dewey-110393101005_at_sebastian.centerline.com>, dewey_at_centerline.com (Devan F. Dewey) writes:
> I recall somewhere that you can make a procedure "return" a value
> and can then treat it like a function.
>
> Does any one know how to do this? An example would be great.
>
I only just found out that they exist myself. I have tried them and they work wonderfully (I don't know why the forms and PL/SQL manuals don't mention them).
The syntax goes like this:
FUNCTION function_name (argument list) RETURN return_type IS BEGIN
.. .. as for a procedure .. ...
RETURN something;
END; And here's a picture (sorry, obscure Australian TV joke here):
FUNCTION double_it (the_number in NUMBER) RETURN NUMBER IS
BEGIN
the_number := the_number * 2;
RETURN the_number;
END;
And here's how you'd use it:
..
a_number := double_it( 23 );
..
or
a_number := double_it( :another_number );
Bye for now.
/\ Steven Champness (champs_at_hhcs.gov.au) / \ Dept Health Housing and Community Services / \ Brisbane Queensland / \ via
/ / \ Canberra Australia
\ / / /
\/ / / / MACINTOSH SOFTWARE AXIOM : If you need a manual to operate it
\/ / / it wasn't designed properly in the \/ / first place ! \/Received on Fri Mar 12 1993 - 06:05:09 CET