[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Check for NUMERIC in field.
You can reduce the number of rows with non-numeric fields by saying "where
tab.field between '0' and ':'" assuming an ascii sort. You can't say
"between '0' and '9'" because that would not include '99'. If the field can
have leading spaces, then this wouldn't work.
-----Original Message-----
From: Larry Roux [mailto:LRoux@syr.edu]
Sent: Monday, February 24, 2003 9:26 AM
To: GJANSEN@aflcio.org; sqr-users@sqrug.org
Subject: Re: [sqr-users] Check for NUMERIC in field.
The problem with the below is that it automatically forces a table scan. If
the table you are selecting on is large this could be a problem.
******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************
>>> GJANSEN@aflcio.org 02/24/03 11:33AM >>>
Depends on your DB, I guess. In Oracle I've done this (for integers)
with
WHERE rtrim(tab.field, '0123456789') IS NULL
If you want to handle reals, that would be a little more code. I'd be
inclined either to set up a package to bust strings into tokens, or else
to see what I could do with the supplied package OWA_PATTERN.
>>> nehal_h_patel@yahoo.com 02/24/03 10:51AM >>>
How can I check if a value is numeric to query on as
noted below :
select *
from <table>
where <table>.field IS numeric
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users