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: [HELP]: isdigit & so on

Re: [HELP]: isdigit & so on

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 29 Sep 1999 13:51:49 -0400
Message-ID: <uVDyN2UdP+PzBE3ulxXDZ6DqYhO1@4ax.com>


A copy of this was sent to christophd_at_bigfoot.com (if that email address didn't require changing) On Tue, 28 Sep 1999 16:48:50 GMT, you wrote:

>I need to check in pl/sql following in a string:
>
>first 2 chars must be alpha
>next 10 numeric
>
>What is the most elegant way to check it (I hate typing a lot)?
>

something like:

 (substr(x,1,1) between 'A' and 'Z' or substr(x,1,1) between 'a' and 'z') and  (substr(x,2,1) between 'A' and 'Z' or substr(x,2,1) between 'a' and 'z') and   translate( replace(substr(x,3),'x','y'),'0123456789','xxxxxxxxxx') = 'xxxxxxxxxx'

will do it (x is a variable you want to check)

>Regards
>Ch.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Sep 29 1999 - 12:51:49 CDT

Original text of this message

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