Home » SQL & PL/SQL » SQL & PL/SQL » Validating a Number Value
Validating a Number Value [message #1156] Fri, 05 April 2002 06:19 Go to next message
Maria
Messages: 57
Registered: August 1999
Member
Is there some sort of function or method that you can use to validate that the value being entered via an input parameter is really a NUMBER and that it does not hold any invalid characters. Thank-you in advance for the help.
Re: Validating a Number Value [message #1157 is a reply to message #1156] Fri, 05 April 2002 06:31 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
nothing by default is availble. But u can create one!.
-------------------------------------------------------
FUNCTION IsNumber (string_ IN VARCHAR2) RETURN BOOLEAN IS
dummy_ NUMBER;
BEGIN
dummy_ := TO_NUMBER(string_);
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END;
----------------------------------
instead of TRUE, return several different answers indicating whether the number is
positive, negative, zero and whether it is an integer. This makes it a very versatile function which I could not live without.
Previous Topic: sqlloader
Next Topic: How can i get the content of procudure from sqlplus?
Goto Forum:
  


Current Time: Tue Mar 19 06:02:58 CDT 2024