Page 1 of 1

Enqueue'ing message and getting 21525

Posted: Tue 22 Jul 2008 14:33
by martyphee
I'm trying to enqueue a message and keep getting this.

{"ORA-21525: attribute number or (collection element at index) %s violated its constraints"}

I found that it was a problem with the commodity1/2. Even though I specified no more than 2 characters it still through the error. When I changed the type to varchar2(20) it worked fine. Seems like your code is sending the wrong number of characters.

CREATE OR REPLACE TYPE ohlc_msg_type AS OBJECT (
sessionDt date,
contract varchar2(20),
xml_qry varchar2(20),
exchCode varchar2(10),
commodity1 varchar2(5),
commodity2 varchar2(5),
year1 number,
year2 number,
month1 number,
month2 number
);
/

execute DBMS_AQADM.create_queue_table( queue_table => 'ohlc_queue_tab', queue_payload_type => 'ohlc_msg_type', multiple_consumers=>true );
execute DBMS_AQADM.create_queue( queue_name => 'ohlc_queue', queue_table => 'ohlc_queue_tab');
execute DBMS_AQADM.start_queue( queue_name => 'ohlc_queue', enqueue => TRUE);


declare
subsc_t sys.aq$_agent;

begin
subsc_t := sys.aq$_agent('ohlc_listener', 'ohlc_queue', 0);
dbms_aqadm.add_subscriber(queue_name => 'ohlc_queue', subscriber => subsc_t);
end;
/

Posted: Thu 24 Jul 2008 16:29
by AndreyR
Hello, Martyphee.

The problem is being investigated now. We will let you know when the solution will be found.

Regards, Andrey.

Posted: Tue 29 Jul 2008 13:05
by martyphee
Any word on this? I have another queue with the same problem.

Posted: Tue 29 Jul 2008 13:28
by AndreyR
We have tested the issue and found no problem in the OraDirect .NET 4.70.38 and Oracle server 10.2.0.1.0

Could you please tell us your Oracle server version and the OraDirect .NET version?

Also please provide a small test project to reproduce the issue, or some steps to get the same error.