Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Object Table
"Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message
news:3F4CD7C4.EC870DF1_at_exxesolutions.com...
> A better use of an object would be something like this:
>
> CREATE OR REPLACE TYPE address_t AS OBJECT (
> address_1 VARCHAR2(40),
> address_2 VARCHAR2(40),
> city VARCHAR2(30),
> state_prov VARCHAR2(2),
> postal_code VARCHAR2(10),
> country VARCHAR2(25))
> /
>
> CREATE TABLE person (
> first_name VARCHAR2(30),
> last_name VARCHAR2(30),
> person_add address_t);
>
> CREATE TABLE organization (
> org_name VARCHAR2(30),
> org_type VARCHAR2(5),
> org_add address_t);
>
> Notice that the 'object' is leveraged to assure that all addresses are
stored
> identically.
Now please write a query that tells how many addresses are in the system. Got it? Wouldn't it be cleaner just to have a Address table without Address object? Received on Wed Aug 27 2003 - 13:40:36 CDT
![]() |
![]() |