Home » SQL & PL/SQL » SQL & PL/SQL » how to validate the input for alphanumaric in oracle 9i (oracle 91)
how to validate the input for alphanumaric in oracle 9i [message #409317] Mon, 22 June 2009 02:27 Go to next message
kashifchughtai
Messages: 113
Registered: October 2007
Senior Member
dear all,

is there any way to check the user input is alphanumeric or not? also if i want to check some special charachter ? how it is possible in oracle 9i?

regards
Re: how to validate the input for alphanumaric in oracle 9i [message #409324 is a reply to message #409317] Mon, 22 June 2009 02:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use TRANSLATE function.
SQL> with 
  2    data as (
  3      select dbms_random.string('X',10) val from dual connect by level<=5
  4      union all
  5      select dbms_random.string('P',10) val from dual connect by level<=5
  6    )
  7  select val, 
  8         nvl2(translate(val,'#ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789','#'),
  9              'KO','ok') isalphanum
 10  from data
 11  /
VAL        ISALPHANUM
---------- ----------
JIFQU0ZNZC ok
B6NIWITG97 ok
CXVQA48V53 ok
895GZF0434 ok
EZN5ET5T6K ok
wLA@$p\_Y! KO
,4w/l=X^\| KO
]3Jw@fg#UL KO
`.@QJ;+l-W KO
J-? ;2;8k# KO

10 rows selected.

Regards
Michel
Re: how to validate the input for alphanumaric in oracle 9i [message #409327 is a reply to message #409324] Mon, 22 June 2009 03:17 Go to previous message
kashifchughtai
Messages: 113
Registered: October 2007
Senior Member
thnkx michel Smile
Previous Topic: Consuming a Java Web Service from PL/SQL using UTL_DBWS
Next Topic: Spreading the data evenly
Goto Forum:
  


Current Time: Sat Dec 10 05:21:56 CST 2016

Total time taken to generate the page: 0.21144 seconds