Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Q: working example of OCI8 with dynamic retrieval of multilevel objects
Hello,
anybody out there who has a working example of OCI8, like the oracle example cdemobj.c -- which seems to be incomplete and has functionall errors.
In particular, I am stuck with dynamically describing and retrieving multilevel objects, such as the example below.
Thanks in advance, Kind Regards,
Herman de Boer.
<example>
drop table t1;
drop type m;
drop type cv;
drop type c;
create type c is object
( c1 number
, c2 date
, c3 varchar2(32)
);
/
create type cv is varray(32) of c;
/
create type m is object
( m1 number
, m2 date
, m3 varchar2(32)
, m4 cv
);
/
create table t1
( id number
, obj m
, trailer number
)
/
insert into t1 values (1, NULL, -1); insert into t1 values (2, m(1, sysdate, 'BLABLA', null), -1); insert into t1 values (3, m(11, sysdate, 'SECOND', cv( c(1, sysdate,'C-BLA'), c(2, null, 'HH-777'))), -1);
commit;
rem
rem how to, using OCI8, get the data, dynamically out of the object
cache,
rem thus without using OTT or hard-coded types.
rem It can be done - sqlplus does it!
select * from t1;
</example> Received on Mon Feb 04 2002 - 09:16:33 CST