Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Function Example?
I'm not going to write it for you but the syntax is as follows:
CREATE OR REPLACE FUNCTION functionname (parameter1 NUMBER) RETURN VARCHAR2 IS
<define variables here>
BEGIN
<your SQL here>
RETURN <some value as a varchar2>
EXCEPTION
WHEN <potential error condition here>
<do something>
WHEN <another potential error condition here>
<do something>
WHEN OTHERS THEN
<do something>
END functionname;
Daniel A. Morgan
Charles Davis wrote:
> Hi, all.
>
> Can someone assist me in writing a function that can tell you if a
> customer number is one of the top ten customers, returning a "YES" or
> "NO" string? I presume a select on the customer table/sales tables are
> needed.
>
> Any help at all would be greatly appreciated. Many thanks.
>
> Charles
Received on Wed Apr 25 2001 - 01:09:37 CDT
![]() |
![]() |