Page 1 of 1

Cant fill BLOB field

Posted: Fri 26 Jun 2015 12:28
by dimon_adv
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

Re: Cant fill BLOB field

Posted: Tue 30 Jun 2015 09:48
by dimon_adv
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.

Re: Cant fill BLOB field

Posted: Tue 30 Jun 2015 10:19
by AlexP
Hello,

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

Re: Cant fill BLOB field

Posted: Tue 30 Jun 2015 10:26
by dimon_adv
The letter was sent to the support, but also the still unanswered...
When the holidays end?

Re: Cant fill BLOB field

Posted: Tue 30 Jun 2015 10:39
by AlexP
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.