Cant fill BLOB field

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Cant fill BLOB field

Post by dimon_adv » Fri 26 Jun 2015 12:28

I have queue based on user object type:

Code: Select all

CREATE OR REPLACE TYPE "TQPL_DOCFOREA"                                          as object
(
  -- Attributes
  Operation integer,
  Template TQPL_TEMPLATE,
  IncomeDoc  TQPL_INCOMEDOC
)

CREATE OR REPLACE TYPE "TQPL_TEMPLATE"                                          as object
(
  -- Attributes
  Template_ID integer,
  Index_FT varchar2(250), 
  Name_FT varchar2(250), 
  Period_Name_FT varchar2(250), 
  Ver_Template integer, 
  Index_Template varchar2(255), 
  Template_Body BLOB, 
  Enq_Time DATE 
)

CREATE OR REPLACE TYPE "TQPL_INCOMEDOC"                                          as object
(
  -- Attributes
  OKPO_ER varchar2(50),
  UNP_ER varchar2(50),
  Index_FT varchar2(250),
  Name_FT varchar2(250),
  PeriodType_Name_FT varchar2(250),
  Index_Template varchar2(255),
  Period_Name_REPORT varchar2(250),
  Doc_Body BLOB,
  Doc_Ticket BLOB,
  Doc_Time DATE, 
  Enq_Time DATE 
)

begin
  dbms_aqadm.CREATE_QUEUE_TABLE(
    queue_table=>'QTBL_DOCFOREA', 
    queue_payload_type=>'AQADMIN.TQPL_DOCFOREA', 
    multiple_consumers=>FALSE, 
    comment=>'some');
  -- create queue
  DBMS_AQADM.CREATE_QUEUE(queue_name=>'Q_DOCFOREA', queue_table=>'QTBL_DOCFOREA');
  -- garnts
  -- Запуск очередей
  Dbms_AQADM.start_queue(queue_name => 'Q_DOCFOREA',
    enqueue => True,
    dequeue => True);
end;
/
When i try enqueue message i fill some fields and its work, but BLOB fields always stay null. Why ?

Code: Select all

procedure TForm13.FillPropsAndEnqueue;
var
  ObjToSave: TOraObject;
  TmpStr: TMemoryStream;
  InValue: AnsiString;
begin
  InValue := 'MsgTest';
  ObjToSave := TOraObject.Create;
  TmpStr := TMemoryStream.Create;
  try
    try
      //Init temp stream
      TmpStr.Write(InValue[1], Length(InValue));
      TmpStr.Position := 0;
      // Create object
      ObjToSave.AllocObject(FIntQueueEA.Session.OCISvcCtx, 'AQADMIN.TQPL_DOCFOREA');
      ObjToSave.AttrAsObject['Template'].AllocObject(FIntQueueEA.Session.OCISvcCtx, 'AQADMIN.TQPL_TEMPLATE');
      ObjToSave.AttrAsObject['IncomeDoc'].AllocObject(FIntQueueEA.Session.OCISvcCtx, 'AQADMIN.TQPL_INCOMEDOC');
      ObjToSave.AttrAsObject['Template'].AttrAsLargeInt['TEMPLATE_ID'] := -1;
...
      // ?? need manual alloc ??
      ObjToSave.AttrAsObject['Template'].AttrAsLob['Template_Body'].AllocLob;
      ObjToSave.AttrAsObject['Template'].AttrAsLob['Template_Body'].LoadFromStream(TmpStr);
      ObjToSave.AttrAsObject['Template'].AttrAsDateTime['Enq_Time'] := Now;
      // without manual init
      ObjToSave.AttrAsObject['IncomeDoc'].AttrAsLob['Doc_Body'].LoadFromStream(TmpStr);
      ObjToSave.AttrAsObject['IncomeDoc'].AttrAsDateTime['Enq_Time'] := Now;
      ObjToSave.AttrAsInteger['OPERATION'] := 1;
      try
        FIntQueueEA.Enqueue(ObjToSave);
      except
        on e: Exception do
        begin
          ShowMessage(Format('Error enque:%s%s', [#13#10, e.Message]));
          Exit;
        end;
      end;
    except
      on E: Exception do
      begin
        ShowMessage(Format('Error:%s%s', [#13#10, e.Message]));
      end;
    end;
  finally
    TmpStr.Free;
    ObjToSave.Free;
  end;
end;
This code without any changes in ODAC 8.1.4 work fine.
What changed ?

p.s. Delphi 2010, ODAC 9.5.15, Oracle 11.2.0.3

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: Cant fill BLOB field

Post by dimon_adv » Tue 30 Jun 2015 09:48

Developers are you alive?
If the problem is to reproduce the error I can send a test project.
Why is not responsible for mail support.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cant fill BLOB field

Post by AlexP » Tue 30 Jun 2015 10:19

Hello,

We had holidays, so we didn't respond you. Please send your Demo application to support*devart*com.

dimon_adv
Posts: 27
Joined: Mon 01 Feb 2010 09:36

Re: Cant fill BLOB field

Post by dimon_adv » Tue 30 Jun 2015 10:26

The letter was sent to the support, but also the still unanswered...
When the holidays end?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Cant fill BLOB field

Post by AlexP » Tue 30 Jun 2015 10:39

Hello,

We have received your email describing the issue with accessing the latest version at secure.devart.com and forwarded it to our sales department. However, there wasn't any sample attached. Please send your sample once more.

Post Reply