Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: can't invoke function (PL/SQL)
In article <01bc408f$6ffa58f0$0200000a_at_pitfall>,
Michael Agbaglo <byteshif_at_cs.tu-berlin.de> wrote:
>I compiled the function below in Oracle for Win95
>
>CREATE OR REPLACE FUNCTION IsNumeric( C IN CHAR ) RETURN BOOLEAN
>IS BEGIN
> RETURN ( C >= '0' AND C <= '9' );
>END;
>
>I did a SELECT IsNumeric('p') FROM DUAL;
>and got an error: no such column ... or similar... WHY?
Actually, you get: PLS-00382: expression is of wrong type
Since you can't create a column in a database table with a boolean datatype, it is logical that a select would be unable to pass back a boolean result value.
You can use your IsNumeric function in PL/SQL code, but you can't use it in a select. The following works:
variable T varchar2(100)
begin
if isnumeric('8') then :t:='True'; else :t:='False'; end if;
end;
/
print T
Steve Cosner Received on Fri Apr 04 1997 - 00:00:00 CST