Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Thumbs up Unanswered: drop column and rename sequence

    hi all,

    Can i rename a sequence?

    and
    Can i drop more than one column in a single statemnet?

    alter table tablename
    drop column column1, column2

    ??

    thanx

  2. #2
    Join Date
    Feb 2004
    Location
    India
    Posts
    135
    Hi,

    RENAME SEQUENCE:
    ------------------------

    RENAME <OLD SEQUENCENAME> TO <NEW SEQUENCE NAME>

    Eg:
    Rename a Database Object Example To change the name of table dept to emp_
    dept, issue the following statement:
    RENAME dept TO emp_dept;
    You cannot use this statement directly to rename columns. However, you can
    rename a column using this statement together with the CREATE TABLE statement
    with AS subquery. The following statements re-create the table static, renaming
    a column from oldname to newname:
    CREATE TABLE temporary (newname, col2, col3)
    AS SELECT oldname, col2, col3 FROM static;
    DROP TABLE static;
    RENAME temporary TO static;

    DROP MULTIPLE Column:
    ------------------------------

    U can drop the multiple COLUMN. First u have to set as UNUSED to invisible to the USER. and then U can DROP the UNUSED COLUMN as given Below.


    ALTER TABLE table_name SET UNUSED (column_name);
    ALTER TABLE table_name SET UNUSED (column_name1, column_name2);

  3. #3
    Join Date
    Feb 2004
    Location
    India
    Posts
    135
    Hi Neema,

    Prev. given DROP COLUMN is for LOGICAL DELETE.

    On large tables the process of physically removing a column can be very time and resource consuming. For this reason you may decide to logically delete.

    PHYSICAL DELETE:

    ALTER TABLE table_name DROP COLUMN column_name;
    ALTER TABLE table_name DROP (column_name1, column_name2);

  4. #4
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62
    TanQQ saravanan.

Posting Permissions

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