Consultor Eletrônico



Kbase 21740: SQL-92 -- Invalid Number String (7498)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/1/2002
SUMMARY:

This Knowledge Base Solution applies to the Progress SQL-92 engine. When executing SQL statements that need to do conversions from a CHARACTER to an INTEGER datatype, you might encounter the following error message:

Invalid number string (7498)

EXPLANATION:

When doing a conversion from a CHARACTER to an INTEGER datatype, the character value needs to be a digit. Converting the CHARACTER value 'ABC' will give error 7498. Converting the CHARACTER value '123' will be successful. This takes into consideration that in certain situations, the SQL-92 engine will automatically perform a datatype conversion which is invisible to the user.

SOLUTION:

Make sure your CHARACTER data is convertible to an INTEGER datatype.

Some examples of queries that will give this error are:

-- SELECT * FROM PUB.TableA WHERE 'FieldA-B' = 1
Use double-quotes instead of single-quotes.

-- SELECT NULLIF("FieldA-B", '?') FROM PUB.TableA
FieldA-B is using datatype INTEGER. The value "?" is not
convertible to an INTEGER.

-- SELECT Custnum*TO_NUMBER('100A') FROM PUB.CUSTOMER
100A can not be converted to an INTEGER.


References to Written Documentation:

Progress SQL-92 Guide and Reference