Here's the table structure
create table SVC_TSK
(
SVC_TSK_ID NUMBER(38) not null,
NME VARCHAR2(50),
TYP NUMBER(38) not null,
DELAY NUMBER(38) not null,
DET VARCHAR2(4000),
EXE_TIME DATE,
SCHEDULED NUMBER(1) default 0 not null,
PER NUMBER(1) not null,
RECURRENT NUMBER(1) default 0 not null,
LOG BLOB,
SPEC_TSK_NFO BLOB,
COMPLETED NUMBER(1) default 0 not null,
TIME_START DATE,
TIME_END DATE
)
I got the problem when I edit an existing field.
I took log with Oracle Monitor with both 3.4.6.1 and 4.0.1.0 components and I can send them if needed. Meanwhile, here's the code that fails ("Edit;" is the instruction that fails).
with odsTask do
begin
SetVariable('p_svc_tsk_id', aCrTask.ID);
try
Open;
if Eof then
Insert
else
Edit;
FieldByName('svc_tsk_id').AsInteger := aCrTask.ID;
FieldByName('nme').AsString := aCrTask.Name;
FieldByName('typ').AsInteger := Integer(aCrTask.Typ);
FieldByName('delay').AsInteger := aCrTask.Scheme.Delay;
FieldByName('det').AsString := aCrTask.Scheme.Detail.CommaText;
FieldByName('exe_time').AsDateTime := aCrTask.Scheme.ExecTime;
FieldByName('scheduled').AsInteger := Bool2Int(aCrTask.Scheduled);
FieldByName('per').AsInteger := Integer(aCrTask.Scheme.Period);
FieldByName('recurrent').AsInteger := Bool2Int(aCrTask.Scheme.Recurrent);
int := 0;
if aCrTask.State in [tsCompleted] then
int := 1;
if (aCrTask.State in [tsCompleted]) and aCrTask.WithErrors then
int := 2;
FieldByName('completed').AsInteger := int;
FieldByName('time_start').AsDateTime := aCrTask.TimeStart;
FieldByName('time_end').AsDateTime := aCrTask.TimeEnd;
Stream := TMemoryStream.Create;
try
Stream.Write(aCrTask.Log.Count, SizeOf(aCrTask.Log.Count));
for i := 0 to aCrTask.Log.Count - 1 do
begin
Stream.Write(TLogLine(aCrTask.Log).Time, SizeOf(TLogLine(aCrTask.Log).Time));
WriteStringToStream(Stream, TLogLine(aCrTask.Log).Msg);
end;
Stream.Position := 0;
TBlobField(FieldByName('log')).LoadFromStream(Stream);
finally
Stream.Free;
end;
Stream := TMemoryStream.Create;
try
aCrTask.GetSpecificProperties(Stream);
Stream.Position := 0;
TBlobField(FieldByName('spec_tsk_nfo')).LoadFromStream(Stream);
finally
Stream.Free;
end;
Post;
finally
Close;
end;
end;