RE: SQL Check for numbers only

RE: SQL Check for numbers only

 

  

Well, well, well!
It's Brett! hehe. How have you been? No "COKE" for you! But, have a caffeine on me! hehe.

--List non numeric data
Select text1
from test2
where translate(text1,'0123456789',
rpad('1',10,'1')) <> rpad('1',length(text1),'1')
/

--List only numeric data
Select text1
from test2
where translate(text1,'0123456789',
rpad('1',10,'1')) = rpad('1',length(text1),'1')
/


It's Fridayyyyyyyyyyyyyyyyyyyyy! Partyyyyyyyyyyyyyyy! hehe.


Have a great Day and Weekend!







Please take a few minutes to provide feedback on the quality of service you received. The Department of Education values your feedback as a customer. Commissioner John L. Winn is committed to continuously assessing and improving the level and quality of services provided to you by Department staff. Simply use the link below. Thank you in advance for completing the survey.


http://data.fldoe.org/cs/default.cfm?staff=Ed.[Email address protected]




-----Original Message-----
From: Brett N Exton
[mailto:oracledba-ezmlmshield-x68889154.[Email address protected]
Sent: Friday, April 28, 2006 5:06 AM
To: LazyDBA Discussion
Subject: SQL Check for numbers only


Having a bad morning and can't think of the best way to tackle this....

I have a 6 char text column which must only contain numbers (0-9) and must not
contain any spurious characters.

Whats the select statement that would check for this.

I really hope this is not an easy solution otherwise I'm going to feel silly
and Ed won't award me any coke !

But I really can't think at the moment....more caffeine needed !

--
Brett Exton.



________________________________________________________________________
This e-mail and any attachments transmitted with it represents the
views of the individual(s) who sent them and should not be regarded
as the official view of Bridgend County Borough Council. The contents
are confidential and intended solely for the use of the addressee. If
you have received it in error, please inform the system administrator
on (+44) 01656 642111.

This e-mail and any attachments have been scanned with 'MessageLabs SkyScan' - http://www.messagelabs.com/

________________________________________________________________________
Maer'r e-bost hwn ac unrhyw atodiadau a drosglwddir gydag ef yn cynrychioli
safbwyntiau'r unigolyn (unigolion) a'u hanfonodd ac ni ddylid eu hystyried fel
safbwynt swyddogol Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr. Mae'r cynnwy
syn gyfrinachol ac wedi'i fwriadu at ddefnydd y person y'i cyfeiriwyd ato yn
unig. Os ydych wedi ei dderbyn mewn camgymeriad, rhowch wybod i weinyddwry system ar (+44) 01656 642111.

Mae'r e-bost hwn ac unrhyw atodiadau wedi cael eu sganio gyda 'MessageLabs SkyScan' - http://www.messagelabs.com/
________________________________________________________________________


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page