Advanced queuing & clob files

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Andrew71
Posts: 1
Joined: Mon 07 Dec 2020 12:45

Advanced queuing & clob files

Post by Andrew71 » Mon 07 Dec 2020 13:28

Hello!
I'm trying to use ODAC component with Delphi 10.3.
There is a problem in the transmission queue of an object of type "CLOB". It contains question marks(??????...) instead of all symbols.
Initial data:
I executed the script in PL/SQL Developer:

Code: Select all

-- create type:
create or replace type XX_QUEUE_TYPE is object
(
   t_type int
  ,t_content varchar2(1000)
  ,t_clob clob

)

-- Create table
begin
  dbms_aqadm.create_queue_table(
    queue_table        => 'XX_QUEUE_TBL',
    queue_payload_type => 'XX_QUEUE_TYPE'
  );
end;

-- Create Queue
begin
  dbms_aqadm.create_queue(
    queue_name  => 'XX_QUEUE_Q',
    queue_table => 'XX_QUEUE_TBL'
  );
end;

-- Starting queue
begin
  dbms_aqadm.start_queue(
    queue_name  => 'XX_QUEUE_Q'
  );
end;
I have configured the OraSession, OraTable, and OraQueue components in the IDE Delphi 10.3.
Next, I created a enqueue-button:

Code: Select all

procedure TForm1.btEnqueueClick(Sender: TObject);
var
  MsgProp: TQueueMessageProperties;
  Payload: TOraObject;
  MsgId: String;

begin
  MsgProp := TQueueMessageProperties.Create;
  try
    MsgProp.Priority := 1;
    Payload := TOraObject.Create;
    try
      Form1.OraSession1.Connect;
      Payload.AllocObject(OraSession1.OCISvcCtx, 'XX_QUEUE_TYPE');
      Payload.AttrAsInteger['t_type'] := 333;
      Payload.AttrAsString['t_content'] := Edit1.Text;
      Payload.AttrAsLob['t_clob'].LoadFromFile('c:\temp\frez.log') ;
      Payload.AttrIsNull['t_clob'] := false;
      MsgId := OraQueue1.Enqueue(Payload, MsgProp);
      meLog.Lines.Add('Inserting: MsgId: ' + MsgId +' - Message: ' + Edit1.Text );
    finally
      Payload.Free;
    end;
  finally
    MsgProp.Free;
  end;
  OraTable1.Close;
  OraTable1.Open;
end;
Procedure btEnqueueClick runs without errors. But the is a ?-charracters instead of symbols in Clob field. All other data fields are correct.

The test file consists of a single UTF 8 encoded phrase "Hello friends!!!"
Where is my mistake?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Advanced queuing & clob files

Post by MaximG » Fri 12 Feb 2021 11:02

Sorry for not getting back to you sooner, we had a technical issue. We'll test our tool and let you know the result within a few days.

Post Reply