Gerard Averill <gaverill_at_chsra.wisc.eduNOSPAM> wrote in message
news:905BBF3F5gaverill_at_144.92.88.10...
> I was wondering if anyone has used or is using the new object-oriented
features
> of Oracle 8.x as part of a "real-world" application. Since these
features,
> from an object-oriented standpoint, are still a little thin, IMHO, I'd be
> interested in how developers are making use of them.
I tried to use these features on 8.1.5 and gave up after several attempts.
Below is a brief list of drawback and "features" i've faced. If something is
fixed in release 3, please, let me know, maybe i will find myself brave
(or stupid) enough to approach them again :)
- can't change a type if something depends on it, without rebuilding
the whole hierarchy. This quickly becomes a nightmare
- can't create a check constraint on attribute (though can do this
for the object table). Very unnatural.
- can't access object, pointed to by ref, from the member function
(use "select from dual" or utl_ref.select_object() instead)
- ref can be used to access attributes, but not member functions:
select h.doc.id from hub h; -- it works
select h.doc.title() from hub h; -- ORA-00904: invalid column name
The solution is to artificially join both tables, using the ref()
function:
h.doc = ref(d). But note the next item:
- optimizer can't understend we access the same column if we mix access
methods:
select h.doc.id, d.id from Hub h, Documents d where h.doc = ref(d)
(h.doc is reference to Documents, thus h.doc.id and d.id is the same
column. Oracle joined the tables twice):
SELECT STATEMENT, COST=0, CARDINALITY=0
NESTED LOOPS OUTER, COST=0, CARDINALITY=0
NESTED LOOPS, COST=0, CARDINALITY=0
TABLE ACCESS FULL HUB, COST=0, CARDINALITY=0
INDEX UNIQUE SCAN DOCUMENTS_PK, COST=0, CARDINALITY=0
INDEX UNIQUE SCAN DOCUMENTS_PK, COST=0, CARDINALITY=0
- attempt to use make_ref in a PL/SQL code results
PLS-00201: identifier 'MAKE_REF' must be declared
- the "with rowid" hint is ignored in most of useful cases:
The rowid hint is not supported for scoped REFs, for REFs with
referential integrity constraints, or for primary key-based REFs
- when a member function returns varchar2, the length of the result is 4000,
which leads to memory overuse. Usage of substr() fixes that, but the code
becames really ugly and even harder to maintain than if the object
features
are not used. This effect could lead to very unefficient key storage use
in
member-based, but i didn't checked this.
This seemed to me enough to stop messing with objects and return
to orthodox methods.
Best regards, Alexei
.. As of next week, passwords will be entered in Morse code
Received on Tue Mar 06 2001 - 02:48:15 CST