How to set an attribute called "header" ("SYS.AQ$_JMS_HEADER
Posted: Fri 01 Apr 2011 14:27
Hi,
I'm new to the ODAC components and Oracle Queues in general.
I used the code from "..\Devart\Odac for RAD Studio 2010\Demos\OdacDemo\Queue\Queue.pas" and altered it.
Everything works fine so far, my result in the "meLog" memo is:
But our customer says that an attribute "header" ("SYS.AQ$_JMS_HEADER") with a value for "text_len" (with a value of "612") should be created. How and where do I create such a header?
They gave me this example:
Any ideas are welcome.
TIA, M. Drück
I'm new to the ODAC components and Oracle Queues in general.
I used the code from "..\Devart\Odac for RAD Studio 2010\Demos\OdacDemo\Queue\Queue.pas" and altered it.
Code: Select all
procedure TQueueFrame.btEnqueueClick(Sender: TObject);
var
MsgProperties: TQueueMessageProperties;
StringPayload, MsgId: string;
ObjectPayload: TOraObject;
begin
MsgProperties := TQueueMessageProperties.Create;
try
MsgProperties.Priority := StrToInt(edPriority.Text);
if rbUseRaw.Checked then begin
...
end
else begin
ObjectPayload := TOraObject.Create;
try
OdacForm.OraSession.Connect; // session must be connected before using its OCISvcCtx property
// ObjectPayload.AllocObject(OdacForm.OraSession.OCISvcCtx, 'OBJ_ODAC_DEPT');
ObjectPayload.AllocObject(OdacForm.OraSession.OCISvcCtx, 'SYS.AQ$_JMS_TEXT_MESSAGE');
try
// ObjectPayload.AttrAsInteger['DeptNo'] := StrToInt(edPayloadDeptNo.Text);
ObjectPayload.AttrAsString['TEXT_VC'] := memPayload.Text; // memPayload is a Memo
except
...
end;
// ObjectPayload.AttrAsString['DeptName'] := edPayloadDeptName.Text;
MsgId := QueueObject.Enqueue(ObjectPayload, MsgProperties);
meLog.Lines.Add('ENQUEUE: MsgId: "' + MsgId + '" Payload: "' +
ObjectPayload.AttrAsString['TEXT_VC'] + '"');
finally
ObjectPayload.Free;
end;
end;
finally
MsgProperties.Free;
end;
end;
Code: Select all
ENQUEUE: MsgId: "9FDD0DBDC5A9EF4DE0402B0A2F036BC7" Payload: "
"
They gave me this example:
Code: Select all
SYS.AQ$_JMS_TEXT_MESSAGE(SYS.AQ$_JMS_HEADER(NULL,NULL,NULL,NULL,NULL,NULL,NULL),612,
'
',NULL)
TIA, M. Drück