How do i select an element of a type object in SQL [message #371675] |
Thu, 23 November 2000 04:19 |
rajaraman
Messages: 3 Registered: November 2000
|
Junior Member |
|
|
Hi,
I've created a type called mark_info with 3 elements and created another type object called mark_table using mark_info. Created a table called stud_table which includes the mark_table as a nested-table.
SQL> create type mark_info
2 ( quarter number(1), m1 number(2), m2 number(2));
SQL> create type mark_table is table of mark_info;
SQL> create table stud_table
2 ( sno number(3) primary key,
name varchar(20),
marks mark_table )
nested table mark_table store as mark_tab );
I inserted some records into the stud_table. Now I want to select the quarter and m1 from the nested object. How do I select. If i say 'select * from stud_table' or 'select marks from stud_table' or select quarter, marks from table( select marks from stud_table)', the query will pull records. but my question is, can't i say 'select s.marks.m1 ....' something like this?
thanks in advance
rajaram
|
|
|