10

I wonder how can i make select statement from table which have a typed column ? Type of this column is defined as:

create or replace TYPE "MYCOL" as table of MYTYPE; 
create or replace TYPE "MYTYPE" as OBJECT
( myid Number, myname Varchar2);

UPD1 Table is defined as

CREATE TABLE "T_TABLE" 
   (    "ID" NUMBER NOT NULL ENABLE, "NAME" "MYCOL" )

If i select this column with select * from T_TABLE i will get this not informative result:

1, MYSCHEMA.MYCOL([MYSCHEMA.MYTYPE],[MYSCHEMA.MYTYPE])

I want just to unwrap this types.

2
  • and how is your table defined? Commented Dec 20, 2012 at 12:34
  • The display is handled by the SQL client. SQL*Plus will display this as e.g.: MYCOL(MYTYPE(1, 'somevalue')) Commented Dec 20, 2012 at 13:43

1 Answer 1

17

Try it like this:

select t."ID", tt.myid, tt.myname 
from "T_TABLE" t, table(t."NAME") tt;

Here is a sqlfiddle demo

Sign up to request clarification or add additional context in comments.

1 Comment

How do you return rows from this query if there is no rows in the nested table?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.