Retrieving PL/SQL associative arrays with OCCI...

  • From: "Geoffrey E. Quelch" <gequelch@xxxxxxxx>
  • To: Oracle List <Oracle-L@xxxxxxxxxxxxx>
  • Date: Thu, 25 Jan 2007 21:55:26 +0000

All,
I'm wondering if anyone can give me a pointer or two to help me resolve a 
problem.

I have a package body defining an associative array:

CREATE OR REPLACE PACKAGE PK_WS_Data AS
    -- Package type declarations
    TYPE IntArray IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;

and now I need to be able to access data of this type returned by a procedure 
in this package as an OUT variable. How does one do this in OCCI?

My attempt is as follows:

std::vector<float>  values;
...
stmnt->registerOutParam( 7, oracle::occi::OCCIVECTOR, 0, 
"PK_WS_Data.NumArray");
...
oracle::occi::getVector(rs, (unsigned int) 7, values);

(which all refer to the same data item) but I get an error:
OCI-22303: type "PK_WS_Data"."NumArray" not found.
Whatever I place in the last argument of the register call gives a similar 
runtime error.

I have found a metalink item: 308592.1 that seems to refer to something 
similar, but they are using an object type, and not using a package.

Does anyone have an example closer to what I'm doing? The OCCI documentation 
doesn't have anything similar that I've found.

Do I need to define this type external to the package and if so what code 
change would I need?

I have been able to do this in PHP easily which is funny, PHP is usually 
harder than OCCI... :-)

Many thanks in advance,
GEQ

-- 
Geoff Quelch
Email: gequelch@xxxxxxxx

--
//www.freelists.org/webpage/oracle-l


Other related posts: