I’ve recently upgraded from Rad Studio 10.1 Berlin to 10.2 Tokyo and ran into a data type problem with my FireDAC queries. The following query illustrates the issue. This is being run against an Oracle database using a TFDPhysOracleDriverLink with the CharacterSet := csUTF8;
query := TFDQuery.Create(self);
query.Connection := FDConnection1;
query.SQL.Add('select ''X'' as test1');
with query.ParamByName('param1') do
DataType := ftWideString;
Value := 'Y';
Rad Studio 10.2 throws the following when the above query is executed:
Exception - Project FireDACTest.exe raised exception class EOCINativeException with message '[FireDAC][Phys][Ora] ORA-12704: character set mismatch'
From my testing it appears there was a change to how the static strings are cast. I can explicitly cast the text in the query using TO_NCHAR(‘’X’’) so it matches the ftWideString of my param. Alternatively, I can change my param to ftString to match the ‘’X’’. Neither option is a feasible.
This behavior is new to Rad Studio 10.2 as the same code executes fine in 10.1. Does anyone have input on how to move forward so the above query executes without error? Possibly a new setting in FireDAC or something on the database side?