Page 1 of 1

'Collection type for payload data type MSG_TYPE does not exist.'

Posted: Wed 28 Nov 2018 10:52
by storm
Hi *,

i am dequeueing an Oracle Advanced Queue succesfully through the following code:

Code: Select all

OracleQueue oracleDequeueQueue = new OracleQueue("QUEUENAME", oracleConnection);
OracleQueueMessage msg = oracleDequeueQueue.Dequeue();

if (msg != null && msg.ObjectPayload != null)
{
    Convert.ToString(msg.ObjectPayload["ID"])
}
When i try to gather a queue array through the next code snippet, i am receiving the error message
System.Exception: 'Collection type for payload data type MESSAGE_TYPE_NAME does not exist.'

Code: Select all

OracleQueue oracleDequeueQueue = new OracleQueue("QUEUENAME", oracleConnection);
OracleQueueMessage[] msgArr = oracleDequeueQueue.DequeueArray(10);

foreach (OracleQueueMessage m in msgArr)
{
    if (m != null && m.ObjectPayload != null)
    {
        Convert.ToString(m.ObjectPayload["ID"]));
    }
}
Whats wrong with my code?

best regards

Re: 'Collection type for payload data type MSG_TYPE does not exist.'

Posted: Wed 05 Dec 2018 10:42
by Pinturiccio
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Re: 'Collection type for payload data type MSG_TYPE does not exist.'

Posted: Mon 21 Jan 2019 14:25
by Pinturiccio
When you use the DequeueArray method, you must have the following array type in Oracle:

Code: Select all

CREATE OR REPLACE TYPE MESSAGE_ARRAY AS
VARYING ARRAY (100) OF MESSAGE_TYPE_NAME;
Please note that length of the array of MESSAGE_TYPE_NAME created in Oracle should be equal or greater then the value of the parameter in the DequeueArray method in your .NET code. We will update our documentation with the corresponding information.