I have an object queue which works fine with PL/SQL code on Oracle 9.2.0.5 both ways (enqueue and dequeue). Connecting to the same schema as before using Delphi 6 and DOA 4.0.6.2 and attempting a Dequeue from the Queue, I get an EVariantTypeCastError for a conversion from null to integer immediately on the dequeue statement.

The application is non-threaded, the queue ist a multi-consumer queue of type 8.1. The object type used has the following signature (quoting from the create statement):

create or replace type abholungen_qtyp as object (
id number(12),
operation char(3),
...
(some more whole number and date fields)
...
stand date,
version number(12)
);

Usually some but obviously not all of the values in a message are null. I tried replacing those with placeholder values in order to get a message totally without any null values, but that didn't have any effect. By the way, on closing the application I regularly get "TOracleObject: Invalid handle" exceptions although I close down connections explicitly. It seems to me as if the implicitly created Object that is to receive the payload doesn't get destroyed in the correct sequence on disconnects. That is just a guess however.

The strangest thing (to me) is that I first had it working for another queue, put in this one and got the errors, commented out the operations on the other queues with the errors remaining, removed the comment, and now the working queue also fails in exactly the same way. Changing the oci.dll from version 9.2.0.5 to 8.1.7.4 did not make any difference, both now fail consistently.

I am not doing anything spectacular, just a simple dequeue in the main thread with wait=1, navigation=first_message and the consumer_name set to exactly the value contained in the messages (I checked in the index IOT to make sure that was the case).

Any ideas what I may be getting wrong? Or should I perhaps upgrade my Oracle client?