Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> NESTED TABLE ... how to SCOPE?
Does anybody know how to do this (I'm trying to simulate RI (scoping)
on a nested table ... here is a generic example that doesn't seem to
work completely ...
CREATE TYPE lookup_typ
AS OBJECT
(
lookup_id NUMBER(1,0),
lookup_desc VARCHAR2(100)
)
/
CREATE TABLE lookup_t
OF lookup_typ (lookup_id CONSTRAINT pk_lookup_lookuptyp PRIMARY KEY)
OBJECT IDENTIFIER IS PRIMARY KEY
/
CREATE TYPE item
AS OBJECT
(
item_id NUMBER(1,0),
lookup_id REF lookup_typ
)
/
CREATE TYPE items AS TABLE OF item
/
CREATE TABLE any_table (regular column_list ..., column9 ITEMS)
NESTED TABLE column9 STORE AS whatever
/
Can there be "RI" on the nested table on the lookup_id column? How can it be scoped at the table level. Oracle does not seem to allow scoping at the CREATE TYPE level.
At this point I get stuck. I can't seem to insert or do anything without getting errors. I thought the "OBJECT IDENTIFIER IS PRIMARY KEY" would get rid of those long OIDs Oracle generates, but no luck.
Any help would be appreciated. I don't think the object-relational features of Oracle are that well documented. Thanks ... Dom Received on Sun Apr 24 2005 - 11:24:28 CDT