Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Object reference again

Object reference again

From: Honglin Su <hosu_at_cs.umbc.edu>
Date: Thu, 19 Aug 1999 11:44:38 -0400
Message-ID: <37BC2666.C58B7258@cs.umbc.edu>

Hi, there,

I am using Oracle 8i. I want to find a good way to use object refence.

e.g.

create type address_obj as object
( street_name varchar2(20),

  house_no number);

create table address_table of address_obj;

create table people
( name varchar2(20),

  address ref address_obj);

The table people has a column, which is reference to address_obj. When I insert an address to the address_table, I want to get its reference which will be used for table people.

e.g.

insert into address_table values ('Maryland Ave', 1000);

In order to get the reference, a way is to use select clause.

select ref (a) from address_table where street_name='Maryland Ave' and house_no=1000;

Is there more simpler way to get the reference? If more than one result are selected from the address_table, how to deal with it? I wish to find a way, upon the insertion an object to a table, I get the reference to that object.

Thank you!

Honglin Received on Thu Aug 19 1999 - 10:44:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US