sql - Locate Cause of IBM DB2 CAST Failure -
i need work on ibm db2 database.
the location
field character(8)
field of numbers.
to sort table, column cast integer
:
select location, partno, instock inventory order cast(location integer)
currently, fails with:
error [22018] [ibm][db2/aix64] sql0420n invalid character found in character string argument of function "integer".
is there quick way determine row failing?
ibm's solution "insure results set query item cast being applied not contain non numeric sql constants when casting numeric type."
that wasn't helpful.
thinking inserted letter o or lower case l, tried this:
select distinct location locations location '%l%' or location '%o%' order location
zero records returned.
that wasn't helpful.
that's ibm error messages , documentation in nutshell.
one place start translate()
function.
select location, partno, instock inventory translate(location, '', ' 0123456789') <> ''
you can add other characters, -
, .
, etc. depending on find.
Comments
Post a Comment