0

i am struggling to read a VARRAY element from oracle 11g database. i am using CPP occi DLL. i can read any other types, and update VARRAY type, but when i try to select VARRAY value, i get an 'access violation' exception in the occi dll :(

here is a simplified scenario:

CREATE TYPE ALIST AS VARRAY(50) OF NUMBER(8)

create table ATABLE (a nmumber(8), b mylist)

insert into mytable values(1, alist(1,2,3))

when i do

oc::Statement* stmt = m_cConnection->createStatement("SELECT b FROM ATABLE");
stmt->executeQuery();

it's OK but when i try to access the VARRAY the same way

oc::Statement* stmt = m_cConnection->createStatement("SELECT a FROM ATABLE");
stmt->executeQuery();

i get

First-chance exception at 0x0094a46d in OracleTester.exe: 0xC0000005: Access violation reading location 0x0000000000000120.

any idea what i am doing wrong? maybe i need to use different API to get VARRAY data ? or do some preparations?

any hint will be appreciated...

Noam
  • 220
  • 1
  • 2
  • 9
  • Do you know of OTT utility? It can generate C++ class representations of database object types for you. https://docs.oracle.com/database/121/LNCPP/objects.htm#LNCPP20197 – douyw Apr 16 '15 at 15:30
  • i saw this in the docs, but, i since i am not a DB expert, and even less expert in oracle, i just followed the simplest driver installation, which is instantclient, and i can't see this utility in the installation folder. anyone know where to download from? – Noam Apr 18 '15 at 08:18
  • well, i've played with OTT, without success :( the only examples i can find are for VARRAY within object, which is not my case (can't change the db schema) – Noam Apr 19 '15 at 11:41

0 Answers0