how to make relations 1 to n and n to n in oracle objects?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[EDIT] I believe the question is referring to Oracle Objects for OLE (OO40) [/EDIT]
For this example, consider a one-to-many relationship between order and line_item. (An order may have zero, one or more line_item, and a line_item is associate with exactly one order.) We’re jumping past all of the modeling steps, and getting to a shell of what the definitions might look like.
One option is to use a reference:
Another alternative it to use a nested table (called a collection type):
[EDIT]
ADDENDUM:
Tony Andrews asks (quite reasonably) why one would want to use “nested tables”. Tony points out that the resulting database structures will be “harder to access”, by which he means (I think) the required query constructs are “non-standard” SQL.
Quite frankly, I can’t think of a good reason that I would use a nested table, but I must at least acknowledge that OO4O does provide support for nested tables.
Why would one choose to use OO4O at all? It provides (ostensibly) improved performance against an Oracle database, by virtue of a native driver that avoids the overhead incurred by ODBC or OLE. It’s also a technology specifically for Oracle, writing an application against the OO4O interface means that the app will essentially be tied to an Oracle database, which may be okay if there’s no requirement for the app to support multiple (interchangeable) database engines.
More information and examples for OO4O are available from Oracle web site:
http://www.oracle.com/technology/tech/windows/ole/index.html
[/EDIT]