Semicolon replaced with a blank space using the builtin driver version 6.7.10
Posted: Mon 07 Dec 2015 09:48
Hello, DevArt!
After upgrading to version 6.7.10 and using the builtin driver we encountered an error when selecting a string value with a semicolon inside. The semicolon gets replaced with a blank space.
With driver from the external DLL the problem is not occurring.
See the code below for reproduction of the problem.
Regards
After upgrading to version 6.7.10 and using the builtin driver we encountered an error when selecting a string value with a semicolon inside. The semicolon gets replaced with a blank space.
With driver from the external DLL the problem is not occurring.
See the code below for reproduction of the problem.
Regards
Code: Select all
program DevArtProblem1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, Data.SqlExpr, Data.DBXCommon, DbxOdaDriverLoader;
function GetTestString(const UseBuiltinDriver: Boolean): string;
const
SDatabase = 'oracle_host:1521:service_name';
SUserName = 'oracle_user';
SPassword = 'oracle_pass';
var
SQLConnection: TSQLConnection;
SQLQuery: TSQLQuery;
begin
SQLConnection:= TSQLConnection.Create(nil);
try
SQLConnection.LoginPrompt:= False;
if UseBuiltinDriver then
SQLConnection.DriverName:= 'DevartOracleDirectBuiltin'
else
SQLConnection.DriverName:= 'DevartOracleDirect';
SQLConnection.VendorLib:= 'dbexpoda40.dll';
SQLConnection.GetDriverFunc:= 'getSQLDriverORADirect';
SQLConnection.LibraryName:= 'dbexpoda40.dll';
SQLConnection.Params.Clear;
SQLConnection.Params.Values[TDBXPropertyNames.Database]:= SDatabase;
SQLConnection.Params.Values[TDBXPropertyNames.UserName]:= SUserName;
SQLConnection.Params.Values[TDBXPropertyNames.Password]:= SPassword;
SQLQuery:= TSQLQuery.Create(nil);
try
SQLQuery.SQLConnection:= SQLConnection;
SQLQuery.SQL.Text:= 'select ''one;two'' as TEST_STRING from DUAL';
SQLQuery.Open;
try
Result:= SQLQuery.Fields[0].AsString;
finally
SQLQuery.Close;
end;
finally
SQLQuery.Free;
end;
finally
SQLConnection.Free;
end;
end;
begin
try
WriteLn('Test string with EXTERNAL driver : ', GetTestString(False));
WriteLn('Test string with BUILTIN driver : ', GetTestString(True));
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
WriteLn('Press any key to continue...');
ReadLn;
end.