Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Question on Function Return values

Re: Question on Function Return values

From: Mark & Kristi Wagoner <mwagoner_at_iac.net>
Date: Thu, 17 Jan 2002 19:02:51 -0500
Message-ID: <a27onb$2ecd$1@genma.iac.net>


The only way to do that would be to return a varchar that can take the value of the number of the string. This isn't the most elegant solution, however.

You might want to consider returning the value in one of the parameters and using the function value as a return code. Or you could raise an exception in the event the invoice number is not found.

"Ian Terence Botham" <botham_ian_at_hotmail.com> wrote in message news:709f185b.0201171545.381a0e2d_at_posting.google.com...
> I wrote a function that usually returns a number but in a specific
> case of the logic , it should return a character. How is this
> possible. Here is what I mean.
>
> create or replace function xx_test return number is
>
> blah number;
>
>
> begin
>
> if logic = true
> then return (blah ); --returns number this is what is going on now...
> else
> return ('INvoice number not found'); --This is text i need to return
>
> How is this possible?
>
> Please let me know as this is stopping me going further.
>
> Thanks
> Ian
>
> I am using oracle 8.1.7 as the database....
Received on Thu Jan 17 2002 - 18:02:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US