Hi.
I having an specific problem with 5.0.2 Driver and MSSQL2005 and Delphi XE.
The driver are changing the EmptyStr value with 'NULL'.
1- Delphi Code
SQLQuery1.Close;
SQLQuery1.SQL.Text := 'Select 1 Where ''1'' = :pString';
SQLQuery1.Params.ParamByName('pString').asMemo := EmptyStr;
SQLQuery1.Open;
2-SQL Generated statement obtained by SQLServer Profiler
exec sp_executesql N'Select 1 Where ''1'' = @P1',N'@P1 varchar(1)',NULL
Does anybody has an idea?
Best Reghards
Eder
Null problem with parameter.asMemo := EmpyStr
-
- Posts: 12
- Joined: Tue 21 Aug 2007 14:25
Hello,
To avoid this problem, you should use the AsString property instead of AsMemo. Here is an example:
To avoid this problem, you should use the AsString property instead of AsMemo. Here is an example:
Code: Select all
SQLQuery1.Close;
SQLQuery1.SQL.Text := 'Select 1 Where ''1'' = :pString';
SQLQuery1.Params.ParamByName('pString').AsString := EmptyStr;
SQLQuery1.Open;