Oleksandr Alesinskyy, April 28, 2011 - 7:30 am UTC
April 28, 2011 - 7:57 am UTC
It would have been neat if the original poster had been a tad more clear in what they were saying/asking.
I don't see why you would use object types - it seems a simple view would do the trick? You already had to point the inserts to the correct base tables - you can just query a view to get what you need from them?
Oleksandr Alesinskyy, April 28, 2011 - 9:25 am UTC
Yes, a view can do the trick - almost...
As each time you add a new child table (or grand-child, or grand-grand-child) you need to modify your view (or views).
So it is doable - but require additional maintenance efforts.
Object views
A reader, April 28, 2011 - 2:24 pm UTC
object views allow you to add new child in this hierarchy without original view modification. Just use "under {parent view}" clause while creating object view for the child. Though you are not explicitly modifying the original parent view - it will be altered behind the scene to include child view in this case.
orace apps
A reader, April 28, 2011 - 2:48 pm UTC
what is responsibility,,,profile options in oracle apps?what are iys functionalities?
Object views @A reader
Oleksandr Alesinskyy, April 30, 2011 - 8:09 am UTC
It is a kind of a "resorting to object types" which I have mentioned in my post. But even this solution does not mimic PostgeSQL functionality completely:
- You cannot inherit from 2 or more parents (in PostgeSQL you can)
- You need to duplicate definition of all columns by a child creation
- changes to the parent table structure are not automatically reflected in its childs
- You need to use 2 commands (create table + create view) instead of single create table.
And so on.
Object views @Oleksandr
A reader, May 02, 2011 - 10:47 am UTC
I'd say i LOVE how object features are implemented in Oracle. They were able to clearly separate them from regular relational DB nature. I'd say - how it is handled in postgres is at least not mature (if not useless).
As for inheriting from more than one parent - I believe multiple inheritance is more evil than benefit. Not surprisingly that pretty much all modern languages got rid of it and switch to interface implementation.
In Oracle - if you want you can use even tables of object types, but object views are MUCH more powerful and convenient way of working with OOO features. To be honest, all I care for OOO - polymorphism. And Oracle allows us to have it in a very elegant way in DB. We are using these features VERY heavily and are pretty happy with them.
Object views
Duke Ganote, May 03, 2011 - 2:40 pm UTC
I suppose, if you really wanted to mimic postgreSQL functionality for this, you could write a proc that would modify the view when a child table was created. Then call it through a DDL trigger. Or at end-of-day, just rebuild it automatically.
@Object views @Oleksandr
A reader, May 08, 2011 - 4:20 pm UTC
1. You completely mixed up behavior inheritance and data structure inheritance. In case PostgerSQL we have later only.
2. As for multiply inheritance - what you are writing reflects quite outdated state (Java and alike), most really modern languages support mix-ins or similar constructs.