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: can't invoke function (PL/SQL)

Re: can't invoke function (PL/SQL)

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/04/04
Message-ID: <5i3j3u$73c@info.csufresno.edu>#1/1

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

Original text of this message

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