I am using the latest version of ODAC. This problem did not occur with version 10.4, but I don't know exactly when it started.
Compiling in either 32 or 64 bit VCL, RAD Studio 10.1 Berlin.
I have reproduced this with multiple Oracle versions (12.2 and 19.0) and with multiple database character sets (EE8ISO8859P2 and UTF8)
Just run these SQLs, in order, in a TSmartQuery connected to a TDBGrid.
Code: Select all
alter session set "_adjust_literal_replacement"=FALSE; alter session set cursor_sharing = 'FORCE'; SELECT '1' AS col1, 'TEST' AS col2, cast ('1' AS CHAR (8)) AS col1_aschar, cast ('TEST' AS CHAR (8)) AS col2_aschar FROM dual;
For example, in the first column, I get : 1í
and in the second column, I get TEST (edit: there was some junk data after this too but I guess the forum removed it)
The junk data changes if I re-execute the SELECT. And it only seems to happen if I select literals. When I select CHAR values from a table, the problem does not occur.