DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Object View

  1. #1
    Join Date
    Aug 2001
    Posts
    134

    Angry

    Please check and help

    SQL> CREATE OR REPLACE TYPE ADDRESS_TY AS OBJECT
    2 (STREET VARCHAR2(20),CITY VARCHAR2(20),STATE VARCHAR2(12));
    3 /

    Type created.

    SQL> CREATE OR REPLACE TYPE PERSON_TY AS OBJECT
    2 (NAME VARCHAR2(20),ADDRESS ADDRESS_TY);
    3 /

    Type created.

    SQL> CREATE TABLE CUSTOMER
    2 (ID NUMBER(3),PERSON PERSON_TY);

    Table created.

    SQL> CREATE VIEW CUST_OV (CUSTOMER_ID,PERSON) AS
    2 SELECT ID,PERSON_TY(NAME,
    ADDRESS_TY(STREET,CITY,STATE)) FROM CUSTOMER;


    SELECT ID,PERSON_TY(NAME,
    ADDRESS_TY(STREET,CITY,STATE)) FROM CUSTOMER
    *
    ERROR at line 2:
    ORA-00904: invalid column name

    Thanx

  2. #2
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    CREATE VIEW CUST_OV (CUSTOMER_ID,PERSON)
    AS
    SELECT ID, PERSON
    FROM CUSTOMER
    /

  3. #3
    Join Date
    Aug 2001
    Posts
    134
    Thanx a lot Julian
    Could I insert values in Normal way ?
    Thanx Again

  4. #4
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Try it, why not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width