v***@cityofcocoabeach.com
2006-03-01 20:33:28 UTC
Hi, I'm new to AS/400 and DB2 (we're currently at ver 4.5)
I've got a C# application that uses an ODBC connection to retrieve data from a DB2 database. When running the application I get the following error: [OdbcException: ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0802 - Data conversion or data mapping error.]
I was able to identify the record that's causing the exception. It looks like the following sql statement
SELECT * FROM CXLIB.TABLE WHERE CAST(SUBSTR(LTRIM(CXLIB.TABLE.FIELD), 2, LENGTH(CXLIB.TABLE.FIELD)) AS INTEGER) > 40
which is trying to filter by dollar amounts is failing when encountering the first dollar amount that contains a comma. I've tried to determine the source data type, but when I run a File Field Description Listing from WRKDBF on the AS/400, the field type for this field is simply described as 'A', which I'm told stands for Alphanumeric(?) but I can't seem to find any reference to such a type in the DB2 SQL reference I obtained online. I've tried removing the comma with a REPLACE function, but apparently our version doesn't support this built-in function.
Any suggestions on how to work around this problem?
Thanks in advance...
I've got a C# application that uses an ODBC connection to retrieve data from a DB2 database. When running the application I get the following error: [OdbcException: ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0802 - Data conversion or data mapping error.]
I was able to identify the record that's causing the exception. It looks like the following sql statement
SELECT * FROM CXLIB.TABLE WHERE CAST(SUBSTR(LTRIM(CXLIB.TABLE.FIELD), 2, LENGTH(CXLIB.TABLE.FIELD)) AS INTEGER) > 40
which is trying to filter by dollar amounts is failing when encountering the first dollar amount that contains a comma. I've tried to determine the source data type, but when I run a File Field Description Listing from WRKDBF on the AS/400, the field type for this field is simply described as 'A', which I'm told stands for Alphanumeric(?) but I can't seem to find any reference to such a type in the DB2 SQL reference I obtained online. I've tried removing the comma with a REPLACE function, but apparently our version doesn't support this built-in function.
Any suggestions on how to work around this problem?
Thanks in advance...