× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 11 Feb 2013 08:45, Jeff Young wrote:
Try this:
SELECT f1.f2.etc.
from Datafile
where substr(OrderQty, 1, 1) = x'40'
Replace the f1,f2,etc with field names from the file, but not the
OrderQty which SQL will see as invalid data.

What columns are on the select column list is moot, if the selection properly effects omission of all of the rows with the invalid decimal value [for the OrderQty field in this case].

The given query should fail with a selection error due to decimal data errors. The implicit cast to character effected by the use of the SUBSTR does not ameliorate the issue for bad data. AFaIK only the HEX() scalar enables access to the data in the column when the data in that column is not valid.

Also whenever using any numeric cast to character, whether implicit or explicitly with something like the CHAR, VARCHAR, or DIGITS casting scalars, best to always explicitly assign\cast the column numeric length and scale to avoid problems due to changes of the base column.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.