I'm using driver version 4.8 dbexpoda40 until recently. Just decided to renew the license and update to version 6.4.7 (latest available).
However, with this update, which began to occur in selects fixed string, is returning a space at the end. Here's an example:
ClientDataSetAuxiliar.Close;
ClientDataSetAuxiliar.CommadText: = 'select ''A'' field1 from dual';
ClientDataSetAuxiliar.Open;
if ClientDataSetAuxiliar.FieldByName ('field1'). AsString = 'A' then
ShowMessage('There goes here');
if ClientDataSetAuxiliar.FieldByName ('field1'). AsString = 'A ' then
ShowMessage('Come here');
Does anyone know why this is happening?
The parameter SQLConnection "TrimFixedChar = True" to solve this problem, but it can bring other problems.
Grateful for the assistance.
Edson Luis Pletsch
Select a fixed string, is adding whitespace
-
- Posts: 1
- Joined: Thu 24 Jul 2014 17:00
Re: Select a fixed string, is adding whitespace
Hello,
If you are using Delphi 2006 or higher, you should set the UseUnicode option to True. Otherwise, set the CharLength option to 1. However, if in the field multi-byte symbols are used, they will be displayed incorrectly.
If you are using Delphi 2006 or higher, you should set the UseUnicode option to True. Otherwise, set the CharLength option to 1. However, if in the field multi-byte symbols are used, they will be displayed incorrectly.
Re: Select a fixed string, is adding whitespace
Hi,
we have this problem with Delhi 7 and Oracle 12c. Is There also a workaround for Delphi 7?
The solutions above dont't work with our version:
SQLConnection.Params.Clear;
SQLConnection.Params.Add('BlobSize=-1');
SQLConnection.Params.Add('DriverName=DevartOracle');
SQLConnection.Params.Add('ErrorResourceFile=');
SQLConnection.Params.Add('LocaleCode=0000');
SQLConnection.Params.Add('Oracle TransIsolation=ReadCommited');
SQLConnection.Params.Add('Multiple Transaction=True');
SQLConnection.Params.Add('DataBase=' + SettingsHandler.GetSetting('database'));
SQLConnection.Params.Add('User_Name=' + SettingsHandler.GetSetting('username'));
SQLConnection.Params.Add('Password=' + SettingsHandler.GetSetting('password'));
SQLConnection.Params.Add('UseUnicode=True');
SQLConnection.Params.Add('TrimFixedChar=True');
SQLConnection.Params.Add('CharLength=1');
we have this problem with Delhi 7 and Oracle 12c. Is There also a workaround for Delphi 7?
The solutions above dont't work with our version:
SQLConnection.Params.Clear;
SQLConnection.Params.Add('BlobSize=-1');
SQLConnection.Params.Add('DriverName=DevartOracle');
SQLConnection.Params.Add('ErrorResourceFile=');
SQLConnection.Params.Add('LocaleCode=0000');
SQLConnection.Params.Add('Oracle TransIsolation=ReadCommited');
SQLConnection.Params.Add('Multiple Transaction=True');
SQLConnection.Params.Add('DataBase=' + SettingsHandler.GetSetting('database'));
SQLConnection.Params.Add('User_Name=' + SettingsHandler.GetSetting('username'));
SQLConnection.Params.Add('Password=' + SettingsHandler.GetSetting('password'));
SQLConnection.Params.Add('UseUnicode=True');
SQLConnection.Params.Add('TrimFixedChar=True');
SQLConnection.Params.Add('CharLength=1');
Re: Select a fixed string, is adding whitespace
To display a correct string in Delphi 7, you should set the TrimFixedChar property to True as shown below:
Code: Select all
procedure TForm1.SQLConnection1AfterConnect(DataSet: TDataSet);
const
coTrimFixedChar = TSQLConnectionOption(103); // boolean
begin
SQLConnection1.SQLConnection.SetOption(coTrimFixedChar, Integer(True));
end;