Consultor Eletrônico



Kbase P73801: SQL-92 and data convertion
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/25/2004
Status: Unverified

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

SQL-92 and data convertion

Invalid number string (7498)

CAUSE:

This 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)

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.

FIX:

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 onvertible to an INTEGER.

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