Steps:
- create a new VCL app
- add a TOraSession and TOraQuery querying a table with a string field
- add a component for the string field using the Fields Editor and lower the Size property of the TStringField
- add a button that opens the query and shows afterwards the Size property of the TStringField component (see my test code below)
- run the app
- press the button and see that the Size property of the TStringField component is equal to the actual size in the database
- close the app
- enable Options.UseUnicode in the TOraSession
- change TStringField to TWideStringField in the .PAS and .DFM file
- run the app again
- press the button
Expected: the Size property of the TStringField component is equal to the actual size in the database
Actual: the Size property of the TStringField component is *not* equal to the actual size in the database
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
const
ExpectedSize = 50;
var
Counter: Integer;
begin
Counter := 0;
if OraQuery1FOO.Size ExpectedSize then
Inc(Counter);
OraQuery1.Open;
if OraQuery1FOO.Size = ExpectedSize then
Inc(Counter);
if Counter = 2 then
ShowMessage('PASS')
else
ShowMessage('FAIL');
end;
Code: Select all
if FieldDefs[i].DataType = ftString then begin
Code: Select all
if FieldDefs[i].DataType in [ftString, ftWideString] then begin