When writing changes to the database 11.2 (insert update) in a field of the nvarchar2 type from the Delphi program, half of the string value is lost
delphi 7
DOA411
oracle 11.2 single-byte encoding
NLS_DATE_LANGUAGE RUSSIAN
NLS_CHARACTERSET RU8PC866
NLS_LENGTH_SEMANTICS BYTE
CREATE TABLE test_uni(
v varchar2(100),
nv nvarchar2(100)
);
oracleDataset.sql.text := 'select t.*, rowid from test_uni t';
ods: TOracleDataSet;
odsV: TStringField;
odsNV: TWideStringField;
procedure TForm1.Button4Click(Sender: TObject);
begin
ods.edit;
ods['nv'] := 'aaaasdfg'; // 8 chars
ods.Post;
ods.Refresh;
end;
ods.debug = true
update TEST_UNI
set NV = :v2
where rowid = :doa__rowid
returning rowid into :doa__rowid
;
:V2 = 'aaaa' // 4 chars
: dOA__ROWID = 'AAFSK6ABVAABHqNAAA'
delphi 7
DOA411
oracle 11.2 single-byte encoding
NLS_DATE_LANGUAGE RUSSIAN
NLS_CHARACTERSET RU8PC866
NLS_LENGTH_SEMANTICS BYTE
CREATE TABLE test_uni(
v varchar2(100),
nv nvarchar2(100)
);
oracleDataset.sql.text := 'select t.*, rowid from test_uni t';
ods: TOracleDataSet;
odsV: TStringField;
odsNV: TWideStringField;
procedure TForm1.Button4Click(Sender: TObject);
begin
ods.edit;
ods['nv'] := 'aaaasdfg'; // 8 chars
ods.Post;
ods.Refresh;
end;
ods.debug = true
update TEST_UNI
set NV = :v2
where rowid = :doa__rowid
returning rowid into :doa__rowid
;
:V2 = 'aaaa' // 4 chars
: dOA__ROWID = 'AAFSK6ABVAABHqNAAA'
Last edited: