Page 1 of 1
Bug in DML Array Insert
Posted: Tue 26 Apr 2011 09:41
by eml79
when insert null in string field
TOraParamDesc.FLen reset in 0
Code: Select all
procedure TOraParamDesc.SetItemNull(Index: integer; Value: boolean);
var
VPtr: IntPtr;
begin
AllocBuffer;
if Value then begin
SetIndicator(Index, -1);
FLen := 0; // 1 this is a bug
Examle: insert 2 string via TOraSql (TOraSql.Params[0].Length := 2)
first string '1234567890' => TOraParamDesc.FLen = 10
second string is null => TOraParamDesc.FLen = 0
in TOCICommand.BindParam
BufferSize := Param.FLen + 1; FLen = 2000
2. after that insert 2 short string [call Execute(2)], max string len 20, but FLen before call is 2000, and not reset
Posted: Wed 27 Apr 2011 14:46
by AlexP
Hello,
Please provide the exact version of ODAC.
The Flen variable doesn't affect the final result even if it is set to 0, so please give a more detailed description of the problem.
The following sample code works fine, please modify it to reproduce the problem:
Code: Select all
{
create table testdmlarray
(
F_STR VARCHAR2(50)
)
}
OraSQL1.SQL.Text :='INSERT INTO testdmlarray VALUES(:str)';
OraSQL1.ParamByName('str').ParamType := ptInput;
OraSQL1.ParamByName('str').DataType := ftString;
OraSQL1.ParamByName('str').Length := 4;
OraSQL1.Prepare;
OraSQL1.ParamByName('str').ItemAsString[1] := '12345678901234567890';
OraSQL1.ParamByName('str').ItemAsString[2] := '';
OraSQL1.ParamByName('str').ItemAsString[3] := '1234567890';
OraSQL1.ParamByName('str').ItemAsString[4] := '';
OraSQL1.Execute(4);
Posted: Fri 20 May 2011 12:03
by eml79
Code: Select all
OraSQL1.ParamByName('str').ItemValue[1] := '12345678901234567890';
OraSQL1.ParamByName('str').ItemValue[2] := '123456789012345';
OraSQL1.ParamByName('str').ItemValue[3] := Null;
OraSQL1.ParamByName('str').ItemValue[4] := '1234567890';
Result: ORA-01480
Posted: Fri 20 May 2011 12:26
by eml79
Code: Select all
OraSQL1.ParamByName('str').Length := 3;
OraSQL1.Prepare;
OraSQL1.ParamByName('str').ItemAsString[1] := '12345678901234567890';
OraSQL1.ParamByName('str').ItemAsString[2] := '';
OraSQL1.ParamByName('str').ItemAsString[3] := '1234567890';
OraSQL1.Execute(3);
Run OK, but in table
'1234567890' <---- !!!! instead of '12345678901234567890'
Null
'1234567890'
ODAC version 6.90.0.60
Posted: Mon 23 May 2011 06:29
by AlexP
Hello,
Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.
Posted: Thu 02 Jun 2011 09:21
by AlexP
Hello,
We have fixed the problem.
This fix will be included in the next build.