error with DBMS_LOB
Posted: Wed 13 Sep 2006 16:12
Hello,
we are using the Odac Net version 5.80.0.35 and we are getting problems when try to store to a clob field. We are using Delphi 7 and Oracle 9i.
Our code works fine without the Net option and it also works fine with a blob field.
The message error is:
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 775
ORA-06512: at line 1
the code is:
Is there any problem in the components?
Thanks.
we are using the Odac Net version 5.80.0.35 and we are getting problems when try to store to a clob field. We are using Delphi 7 and Oracle 9i.
Our code works fine without the Net option and it also works fine with a blob field.
The message error is:
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 775
ORA-06512: at line 1
the code is:
Code: Select all
//we prepare the following statement:
sql := 'UPDATE table SET field=:FIELD WHERE condition';
FSQL.ParamByName('FIELD').ParamType := ptInput;
//Check if it is a clob or blob
if ABlobType=ftOraClob then
begin
FSQL.ParamByName('FIELD').AsOraClob.OCISvcCtx := FTmpTransaction.OCISvcCtx;
FSQL.ParamByName('FIELD').AsOraClob.CreateTemporary(ltClob);
end
else
begin
FSQL.ParamByName('FIELD').AsOraBlob.OCISvcCtx := FTmpTransaction.OCISvcCtx;
FSQL.ParamByName('FIELD').AsOraBlob.CreateTemporary(ltBlob);
end;
try
if ABlobType=ftOraClob then
begin
FSQL.ParamByName('FIELD').AsOraClob.LoadFromStream(AValue);
FSQL.ParamByName('FIELD').AsOraClob.WriteLob; //<---- ERROR !!!!
end
else
begin
FSQL.ParamByName('FIELD').AsOraBlob.LoadFromStream(AValue);
FSQL.ParamByName('FIELD').AsOraBlob.WriteLob;
end;
except
on E: Exception do
//Handle exception
end;
//execute statement
...
Thanks.