On 13-Dec-2013 09:48 -0800, Vernon Hamberg wrote:
I might suggest being explicit about casting - we had an example here
of a numeric field that is an employee code - obviously not involved
in calculations. It is 6 digits long.
Some things would not pass if this predicate is used -
empid like '1%'
Something like that, anyhow.
So I made a point of using the digits() function on the numeric
That predicate probably _would function_ as typically desired, with
the implicit casting; i.e. selecting employees with an identifier that
begins with a digit-one, irrespective the magnitude of the numeric value.
However the predicate EMPID LIKE '%1' would likely _not function_ as
desired; i.e. selecting employees with an identifier that ends with a
digit-one, irrespective the magnitude of the numeric value. That is
because the actual result will have omitted any value that ended in a
digit-one where the numeric value was less than 100000. Using that LIKE
predicate, explicitly casting using DIGITS will select any numeric value
ending in a digit-one.
This mailing list archive is Copyright 1997-2020 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