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

Home -> Community -> Usenet -> c.d.o.server -> Re: Q] 1 more question about OBJECT type

Re: Q] 1 more question about OBJECT type

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 11 Jun 1999 01:39:48 GMT
Message-ID: <376268d5.4372176@newshost.us.oracle.com>


A copy of this was sent to ksjune <ksjune_at_sys.gsnu.ac.kr> (if that email address didn't require changing) On Fri, 11 Jun 1999 10:24:55 +0900, you wrote:

>Hi!!!
>
>I have 1 more questions about OBJECT type.
>
>SQL> desc personal;
> Name Null? Type
> -------------------------------- -------- ---------------------------
> NAME VARCHAR2(10)
> ADDR ADDR_T
> HOMEREF REF OF HOME_T
>
>SQL> insert into home_tbl values ( home_t( '1-202-202-3030' ) );
>1 row created.
>
>SQL> insert into personal
> 2 select pers_t( 'Tom', addr_t( '123 Main Street' ), ref(h) )
> 3 from home_tbl h
> 4 /
>1 row created.
>
>SQL> commit;
>Commit complete.
>
>SQL> select * from personal where name = 'Tom';
>NAME ADDR(ADDR_T_ADDRESS) HOMEREF
>---------- ---------------------------------------
>----------------------------------------------------------------------
>Tom ADDR_T('123 Main Street')
>A00A0C971685299669D621D4911D3A68A00A0C9716852
>
>SQL> select name, addr,deref(homeref) from personal
> 2 where name = 'Tom'
>NAME ADDR(ADDR_T_ADDRESS) DEREF(HOMEREF)(HOME_T_TELEPHON)
>----------- --------------------------------
>-------------------------------------------------
>Tom ADDR_T('123 Main Street') HOME_T('1-202-202-3030')
>
>Question))
> How can I get the only data of query?
> The result of type is ADDR_T('123 Main Street').
> But I want to get '123 Main Street'
>

SQL> select p.addr.addr_t_address from personal p;

ADDR.ADDR_T_ADDRESS



123 Main Street

> Thanks.
>
> mailto:ksjune_at_sys.gsnu.ac.kr

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

Current article is "Fine Grained Access Control", added June 8'th  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jun 10 1999 - 20:39:48 CDT

Original text of this message

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