I'am using Direct Oracle Access version: 4.1.3.0
While using TOracleDirectPathLoader with DelphiXE2 for example if i load a line which has 12 characters when i use length function in database it shows 24 characters.
And 1st char is belongs to my data 2nd one is chr(0) null data.
And 3rd char is belongs to my data 4th one is chr(0) null data.
And 5th char is belongs to my data 6th one is chr(0) null data.
My oracle db and client version is Oracle 10g.
My code vas working on Delph7 regularly but not working on Delphi XE2.
var
F: TextFile;
i, j, l, row, Rownum, ArrSize: Integer;
Str, err_msg, jDated, JTimed, JDtRow: String;
tmp_Record: array of array of String;
l_Level, l_file_status: Integer;
l_Msg: WideString;
begin
//Path'i verilen dosyayı ArrSize'a atanan değişken değerince kayıt olarak OPLoader'ın Tablosuna atar.
//ArrSize 1000 ise 1000'er li şekilde atar...
//Result := 0;
err_msg := '';
l_level := 0;
l_file_status := 0;
try
l_file_status := 0;
AssignFile(F, File_Path_and_Name);
l_file_status := 5;
try
Reset(F);
except
on E: Exception do
begin
Result := 0;
CloseFile(F);
WriteError(E.Message, File_Name, Dtr_Type);
Exit;
end;
end;
l_file_status := 10;
except
on E : Exception do
begin
Result := 0;
CloseFile(F);
WriteError(e.Message + ' - ' + 'File Opening Status: "' + IntToStr(l_file_status) + '"', File_Name, Dtr_Type);
Exit;
end;
end;
O_Get_Param.SetVariable('I_DTR_TYPE', Dtr_Type);
O_Get_Param.SetVariable('I_FILE_NAME', File_Name);
O_Get_Param.Execute;
JDated := O_Get_Param.GetVariable('O_JDATED');
JTimed := O_Get_Param.GetVariable('O_JTIMED');
JDtRow := O_Get_Param.GetVariable('O_JDTROW');
if JDated = '' then
begin
Result := -1;
CloseFile(F);
Exit;
end;
ArrSize := 1000;
SetLength(tmp_Record, 1000, O_Loader.Columns.Count);
l := O_Loader.Columns.Count; //Length(tmp_Record[0]);
Rownum := 0;
Row := 0;
i := 0;
try
l_level := 0;
O_Loader.Prepare;
while not Eof(F) do
begin
l_level := 5;
ReadLn(F, Str);
l_Level := 10;
Inc(Rownum);
l_Level := 20;
tmp_Record[0] := JDated;
tmp_Record[1] := JTimed;
tmp_Record[2] := JDtRow;
tmp_Record[3] := IntToStr(Rownum);
tmp_Record[4] := Str;
l_Level := 30;
for j := 0 to l-1 do
begin
if O_Loader.Columns[j].DataSize >= Length(tmp_Record[j])then
begin
O_Loader.Columns[j].SetData(Row, @tmp_Record[j][1], Length(tmp_Record[j])); //Length(tmp_Record[j]));
end
else
begin
try
l_Msg :=
O_Loader.Columns[j].Name + ' alanına ' +
IntToStr(Length(tmp_Record[j])) + ' karakter veri girilmeye
While using TOracleDirectPathLoader with DelphiXE2 for example if i load a line which has 12 characters when i use length function in database it shows 24 characters.
And 1st char is belongs to my data 2nd one is chr(0) null data.
And 3rd char is belongs to my data 4th one is chr(0) null data.
And 5th char is belongs to my data 6th one is chr(0) null data.
My oracle db and client version is Oracle 10g.
My code vas working on Delph7 regularly but not working on Delphi XE2.
var
F: TextFile;
i, j, l, row, Rownum, ArrSize: Integer;
Str, err_msg, jDated, JTimed, JDtRow: String;
tmp_Record: array of array of String;
l_Level, l_file_status: Integer;
l_Msg: WideString;
begin
//Path'i verilen dosyayı ArrSize'a atanan değişken değerince kayıt olarak OPLoader'ın Tablosuna atar.
//ArrSize 1000 ise 1000'er li şekilde atar...
//Result := 0;
err_msg := '';
l_level := 0;
l_file_status := 0;
try
l_file_status := 0;
AssignFile(F, File_Path_and_Name);
l_file_status := 5;
try
Reset(F);
except
on E: Exception do
begin
Result := 0;
CloseFile(F);
WriteError(E.Message, File_Name, Dtr_Type);
Exit;
end;
end;
l_file_status := 10;
except
on E : Exception do
begin
Result := 0;
CloseFile(F);
WriteError(e.Message + ' - ' + 'File Opening Status: "' + IntToStr(l_file_status) + '"', File_Name, Dtr_Type);
Exit;
end;
end;
O_Get_Param.SetVariable('I_DTR_TYPE', Dtr_Type);
O_Get_Param.SetVariable('I_FILE_NAME', File_Name);
O_Get_Param.Execute;
JDated := O_Get_Param.GetVariable('O_JDATED');
JTimed := O_Get_Param.GetVariable('O_JTIMED');
JDtRow := O_Get_Param.GetVariable('O_JDTROW');
if JDated = '' then
begin
Result := -1;
CloseFile(F);
Exit;
end;
ArrSize := 1000;
SetLength(tmp_Record, 1000, O_Loader.Columns.Count);
l := O_Loader.Columns.Count; //Length(tmp_Record[0]);
Rownum := 0;
Row := 0;
i := 0;
try
l_level := 0;
O_Loader.Prepare;
while not Eof(F) do
begin
l_level := 5;
ReadLn(F, Str);
l_Level := 10;
Inc(Rownum);
l_Level := 20;
tmp_Record[0] := JDated;
tmp_Record[1] := JTimed;
tmp_Record[2] := JDtRow;
tmp_Record[3] := IntToStr(Rownum);
tmp_Record[4] := Str;
l_Level := 30;
for j := 0 to l-1 do
begin
if O_Loader.Columns[j].DataSize >= Length(tmp_Record[j])then
begin
O_Loader.Columns[j].SetData(Row, @tmp_Record[j][1], Length(tmp_Record[j])); //Length(tmp_Record[j]));
end
else
begin
try
l_Msg :=
O_Loader.Columns[j].Name + ' alanına ' +
IntToStr(Length(tmp_Record[j])) + ' karakter veri girilmeye