Unicode in ExecuteDirect()
Posted: Mon 13 Dec 2010 14:42
I have D2011 and DbxSda 4.75.27
I write into one nvarchar field with SQLConnection.ExecuteDirect().
With parameters is all ok:
But directly writing unicode characters do not work:
All unicode characters is replaced with ?
In MySQL and utf8 I do not have this problem.
I write into one nvarchar field with SQLConnection.ExecuteDirect().
With parameters is all ok:
Code: Select all
ps := TParams.Create(nil);
p := ps.AddParameter;
p.Name := '1';
p.DataType := ftWideString;
p.ParamType := ptInput;
p.Value := 'ȘȚщЩ';
SQLConnection1.Execute('UPDATE table SET Field=?', ps);
ps.Free;
Code: Select all
SQLConnection1.ExecuteDirect('UPDATE table SET Field=''ȘȚщЩ''')
In MySQL and utf8 I do not have this problem.