× 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 13 Feb 2013 22:38, CRPence wrote:
<<SNIP>>
≥ mod(length(digits(ifnull(m.OrderQty, dec(0, 1)))), 2) odd_prec
<<SNIP>>

The above expression will fail to produce expected results whenever the precision=scale for the column OrderQty, thus the given query can not be used to validate packed decimal when the column being reviewed for bad decimal data has a precision=scale. Ugh :-( That lack of PRECISION and SCALE scalars definitely seems to be a problem for making a solution with just some expressions in a query.

Maybe that remaining stumbling-block will motivate me to finally create the PROCEDURE that would create a VIEW in QTEMP using the column LENGTH and NUMERIC_SCALE from SYSCOLUMNS to generate the necessary logic to validate all BCD columns of a named physical file [which presumably would normally not be a TABLE because a TABLE should be protected from the issue of bad decimal data, unlike the DDS PF]. If so, I will probably encapsulate the validation [for both PACKED decimal and ZONED decimal] in a single UDF invoked effectively like the following, returning a zero for false and a one for true:
VALID_BCD(HEX(column_name), DATA_TYPE, LENGTH, NUMERIC_SCALE)


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.