ORA-22636 when selecting from ANYDATA table using Instant Client

This seems to work fine with the built-in Oracle client, but not with the Instant Client.

CREATE OR REPLACE TYPE test_type AS OBJECT ( val NUMBER );

CREATE TABLE test_table AS (
  SELECT ANYDATA.convertObject( NEW test_type(1) ) AS val FROM dual
);

SELECT * FROM test_table;
>> SELECT * FROM test_queue_qtab
  *
Error at line 0
ORA-22636: object or collection unpickling failed due to corrupt image

This also happens in the Data tab of the Description dialog of the queue table.

The built-in Oracle client has no problems with this:
image


Alternative way (I first encountered this with an Advanced Queue table):

-- Preparation
BEGIN
  sys.dbms_aqadm.create_queue_table( 'TEST_QUEUE_QTAB', 'sys.ANYDATA' );
  sys.dbms_aqadm.create_queue( 'TEST_QUEUE', 'TEST_QUEUE_QTAB' );
  sys.dbms_aqadm.start_queue( 'TEST_QUEUE' );
END;
/

CREATE OR REPLACE TYPE test_type AS OBJECT ( val NUMBER );

DECLARE
  v_enqueue_options              dbms_aq.enqueue_options_t;
  v_message_properties           dbms_aq.message_properties_t;
  v_message_handle               RAW(16);

  v_payload                      sys.ANYDATA := ANYDATA.convertObject( NEW test_type(1) );
BEGIN
  dbms_aq.enqueue(
      queue_name             => 'TEST_QUEUE',
      enqueue_options        => v_enqueue_options,
      message_properties     => v_message_properties,
      payload                => v_payload,
      msgid                  => v_message_handle
    );
END;

-- Execution
SELECT * FROM test_queue_qtab;

Hi Peter,

Which Oracle client version are you using?

-John

Client version was 21.12.0.0.
I have now also tried it with 23.9.0.2.5, with the same result, just a more detailed message:

ORA-22636: object or collection unpickling failed due to corrupt image
Help: https://docs.oracle.com/error-help/db/ora-22636/

Database version is 19.0.

Hi Peter,

Thanks for the details.

I tried it in SQL*Plus and see the same error, so it's an Oracle issue, not Toad.

-John