error with DBMS_LOB

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bep
Posts: 4
Joined: Tue 01 Aug 2006 12:08

error with DBMS_LOB

Post by bep » 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:

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
...
Is there any problem in the components?

Thanks.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 14 Sep 2006 13:45

We couldn't reproduce this error. Please specify versions of Oracle Server and Oracle Client you use. If it is possible send to ODAC support address complete sample that demonstrates this problem and include script to create server objects.

bep
Posts: 4
Joined: Tue 01 Aug 2006 12:08

Post by bep » Thu 14 Sep 2006 17:31

we have sent a sample to [email protected].

We expect an answer

thanks

bep
Posts: 4
Joined: Tue 01 Aug 2006 12:08

Post by bep » Thu 21 Sep 2006 08:35

challenger wrote:
"The error occurs because last symbol of the text that you insert into CLOB is #0. To make your
program work add line

FStream.Size := FStream.Size - 1;
before
SmartQuery.ParamByName('LOB').AsOraClob.LoadFromStream(FStream);

Best regards,
Oleg Plashkin "
thanks! It works...

Many, many thanks!

Post Reply