How to pass and receive associative arrays with ODP.NET

Posted by Marcus Hammarberg on September 9, 2008
Stats
"How to pass and receive associative arrays with ODP.NET" - that question is sure to have to annoyed a lot of programmers. We have really pulled our hair over this problem and when you search for it on the net there is not very much helpful to be found.

We are using a feature of the ODP.NET that allows you to send arrays of parameters to and from stored procedures in Oracle. This is called associative arrays and is described in great detail in this article.

BUT... of course there is a but. This article doesn't describe how to receive arrays back from a stored procedure. This is described here.

The trick (and confusing part) is that the size of the output array needs to be specified a priori (on beforehand) even for output parameters. A bit strange but it works.

Published by Marcus Hammarberg on Last updated