trailing blank / difference CF10 and CF2016
- December 5, 2019
- 1 reply
- 1590 views
We're having a strange problem since the code was migrated from CF10 to CF2016. I'd appreciate your opinions. There is something strange with the way data are retrieved from an AS400 database. The customer used an ODBC driver but installed an AS400 Java driver and the problem persists.
The screenshot shows a query on an AS400 table and a subsequent QoQ. The left version is CF10, the right version is CF2016.
It appears that alphanumeric values on the AS400 come with a trailing blank (LVSROM="QW" but it is in fact "QW "). LVSROM is just an example, the same happens with other alphanumeric fields. The old version of the subsequent QoQ finds something, surprisingly, even though the where clause says "='QW'" and even though there is a trailing blank in the data - CF seems to ignore this trailing blank - in fact the query doesn't even work if the trailing blank is attached in the where clause (see example). I don't understand this but it worked.
The QoQ in the 2016 CF version (right side) won't retrieve data if the field is specified in the where clause, neither without the blank nor with the blank attached. It only retrieves data if the where clause is omitted. What is going on here?
Hopefully there is some setting somewhere that returns CF2016 to the behaviour it had in CF10. We want to avoid having to rewrite a mountain of code, adding trim everywhere, just because of this effect.
Maybe I'm missing something but I don't know what it could be.
-Michael
(SCREENSHOT added as attachment because the inline image appears too small here)
