Results 1 to 4 of 4

Thread: Duplicate table

  1. #1
    Join Date
    Oct 2009
    Posts
    88
    Rep Power
    0

    Default Rename Column Name

    An how to rename a column name of database table query plz
    Last edited by anilkumar_vist; 01-09-2010 at 10:44 AM.

  2. #2
    abollm is offline Member
    Join Date
    Jan 2010
    Location
    D-Munich
    Posts
    7
    Rep Power
    0

    Default

    An how to rename a column name of database table query plz
    Which RDBMS you have?

    For Oracle it would be this:
    Java Code:
    ALTER TABLE mytable RENAME COLUMN col1 TO col2;

  3. #3
    Join Date
    Oct 2009
    Posts
    88
    Rep Power
    0

    Default

    i am using MS-ACCESS

  4. #4
    abollm is offline Member
    Join Date
    Jan 2010
    Location
    D-Munich
    Posts
    7
    Rep Power
    0

    Default

    Quote Originally Posted by anilkumar_vist View Post
    i am using MS-ACCESS
    Below is the syntax for the alter table statement borrowed from Microsoft Access 2003 help system.

    Java Code:
    ALTER TABLE table {ADD {COLUMN field type[(size)] [NOT NULL] [CONSTRAINT index] |
    ALTER COLUMN field type[(size)] |
    CONSTRAINT multifieldindex} |
    DROP {COLUMN field I CONSTRAINT indexname} }
    The ALTER TABLE statement has these parts:
    Part Description
    table The name of the table to be altered.
    field The name of the field to be added to or deleted from table. Or, the name of the field to be altered in table.
    type The data type of field.
    size The field size in characters (Text and Binary fields only).
    index The index for field.
    multifieldindex The definition of a multiple-field index to be added to table.
    indexname The name of the multiple-field index to be removed.

    It seems that it isn't possible to rename am an existing column. For that reason you should add a new column, copy the data, then delete the original column.


    Hth and good luck

Similar Threads

  1. Replies: 1
    Last Post: 01-08-2010, 06:19 AM
  2. Duplicate Input Boxes
    By habester in forum New To Java
    Replies: 3
    Last Post: 11-09-2009, 06:13 PM
  3. Duplicate XML decleration
    By gyl2009 in forum XML
    Replies: 0
    Last Post: 03-11-2009, 05:13 PM
  4. Duplicate Files Remover
    By caps_lock in forum New To Java
    Replies: 0
    Last Post: 01-05-2009, 01:31 AM
  5. random string are duplicate
    By googgoo in forum New To Java
    Replies: 3
    Last Post: 04-03-2008, 10:01 AM

Posting Permissions

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