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

Thread: Materilaized view - remove column

  1. #1
    Join Date
    Feb 2001
    Location
    Bangalore, India
    Posts
    109

    Materilaized view - remove column

    Can a column be dropped from a materialized view?

  2. #2
    Join Date
    Nov 2000
    Posts
    224
    Yes, U Can.

    SQL> create materialized view testv as select sysdate onecol, sysdate twocol from dual;

    Materialized view created.

    SQL> desc testv
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    ONECOL DATE
    TWOCOL DATE

    SQL> alter table testv drop column twocol;

    Table altered.

    SQL> desc testv
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    ONECOL DATE

  3. #3
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    That only drops the column off the under lying table - if you check DBA_OBJECTS for the view it will be invalid, and the recompile will fail. I'm pretty sure you need to drop and re-create it

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