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 -> formating the nestedtable select output

formating the nestedtable select output

From: Lucas Carvalho Teixeira <lucascarvalho_at_gmail.com>
Date: Wed, 20 Jun 2007 17:46:11 -0000
Message-ID: <1182361571.910473.11820@o11g2000prd.googlegroups.com>


CREATE TYPE Course AS OBJECT (

    course_no NUMBER(4),
    title VARCHAR2(35),
    credits NUMBER(1));

 CREATE TYPE CourseList AS TABLE OF Course;

 CREATE TABLE department (

    name     VARCHAR2(20),
    director VARCHAR2(20),
    office   VARCHAR2(20),

    courses CourseList)
    NESTED TABLE courses STORE AS courses_tab;

   INSERT INTO department

      VALUES('Psychology', 'Irene Friedman', 'Fulton Hall 133',
         CourseList(Course(1000, 'General Psychology', 5),
                    Course(2100, 'Experimental Psychology', 4),
                    Course(2200, 'Psychological Tests', 3),
                    Course(2250, 'Behavior Modification', 4),
                    Course(3540, 'Groups and Organizations', 3),
                    Course(3552, 'Human Factors in Busines', 4),
                    Course(4210, 'Theories of Learning', 4),
                    Course(4320, 'Cognitive Processes', 4),
                    Course(4410, 'Abnormal Psychology', 4)));

I just want to remove the "CourseList" and "Course" words from my select output.
I can do it on my app but it will require a high computer processing. Cuz the select output can return to me more than 1000 rows. So I want to know if it is possible to do into the oracle server.

When I do the SELECT * FROM department;

The "courses" fields returns:
COURSELIST(COURSE(1000, 'General Psychology', 5), COURSE(2100, 'Experimental Psychology', 4), COURSE(2200, 'Psychological Tests', 3),

COURSE(2250, 'Behavior Modification', 4), COURSE(3540, 'Groups and
Organizations', 3), COURSE(3552, 'Human Factors in Busines', 4),
COURSE(4210, 'Theories of Learning', 4), COURSE(4320, 'Cognitive
Processes', 4), COURSE(4410, 'Abnormal Psychology', 4))

But I need to return this:
((1000, 'General Psychology', 5), (2100, 'Experimental Psychology', 4), (2200, 'Psychological Tests', 3), (2250, 'Behavior Modification', 4),(3540, 'Groups and Organizations', 3), (3552, 'Human Factors in Busines', 4),(4210, 'Theories of Learning', 4), (4320, 'Cognitive Processes', 4),(4410, 'Abnormal Psychology', 4)) Received on Wed Jun 20 2007 - 12:46:11 CDT

Original text of this message

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