Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to select from object column
Thanks
Chandini Paterson wrote:
> Hi,
> Try this
>
> SQL> create type mytype as object
> 2 (att1 number,
> 3 att2 number);
> 4 /
>
> Type created.
>
> SQL> create table mytable
> 2 (col1 mytype);
>
> Table created.
>
> SQL> insert into mytable
> 2 values(mytype(1,2));
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select p.col1.att1 from mytable p;
>
> COL1.ATT1
> ---------
> 1
>
> SQL> select * from mytable;
>
> COL1(ATT1, ATT2)
> -----------------------------------------------
> MYTYPE(1, 2)
>
> HTH,
> Chandini Paterson
>
> -----Original Message-----
> Sent: 01 February 2001 10:20
> To: Multiple recipients of list ORACLE-L
>
> Hi Gurus !
>
> I've got a table and an object type as follows
>
> CREATE TYPE OBJECT AS (ATT1 NUMBER, ATT2 VARCHAR2(5));
>
> CREATE TABLE PARAM(COL1 T_PARAM);
>
> How can I select the ATT1 values from the table?
>
> Select COL1.ATT1 from param; doesn`t work.
>
> Gyula
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Andor Gyula
> INET: gy.andor_at_euromacc.hu
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Chandini Paterson
> INET: chandini.paterson_at_morse.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andor Gyula INET: gy.andor_at_euromacc.hu Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Feb 01 2001 - 05:55:34 CST