DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Adding column.

  1. #1
    Join Date
    Jul 2000
    Posts
    147
    Oracle 8.0.5
    --------------

    Is it possible to add a new column in a table (where data already exists)?


    Col1
    Col2

    And I want to put in a new column between Col 1 and Col 2.

    How?


    [Edited by dba_dada on 06-27-2002 at 09:47 AM]

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    You can add a column using the 'alter table...' command but you cannot specify where the column will go. It is always appended to the end of the table.

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Another chrisrlong opportunity...

    The position of the columns in a relational structure is totally irrelevent. If your design is dependant on the order of the attributes, your design is wrong.
    Jeff Hunter

  4. #4
    Join Date
    Jan 2001
    Posts
    3,134

    Smile

    I hate to give any YANNI fan credit but Jeff has a good (if not borrowed) point.

    MH
    I remember when this place was cool.

  5. #5
    Join Date
    Jul 2000
    Posts
    147
    Mr.Hanky


    What are you talking about?????????? What YANNI fan got to do with Adding column??????

    If you don’t have a solution…just don’t bother to reply….
    ----------------------------------------------------------------

    Jeff:

    Thanks. You are right, bad Design.

    But we didn’t design it, just inherited from the previous contractor…



    [Edited by dba_dada on 06-27-2002 at 11:20 AM]

  6. #6
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    Would there not be an argument for it when you are adding a new NOT NULL column? Aren't we supposed to have all NOT NULL columns at the 'head' of the table, followed by the optional ones? Seem to remember this from a while back.

  7. #7
    Join Date
    Aug 2001
    Posts
    267
    It is possible

    it you got table test
    row1
    row2

    create table test1 ..Here is syntax ...

    create table test1 as select row1,' ' dum,row2 from test;

    then drop test ..Rename test1 as test ;
    Raghu

  8. #8
    Join Date
    Jan 2001
    Posts
    3,134
    Originally posted by dba_dada
    Mr.Hanky


    What are you talking about?????????? What YANNI fan got to do with Adding column??????

    If you don’t have a solution…just don’t bother to reply….
    ----------------------------------------------------------------


    [Edited by dba_dada on 06-27-2002 at 11:20 AM]
    How bout I loan you a quarter so you can run out and buy yourself a sense of humor?

    BITE ME!!

    MH
    I remember when this place was cool.

  9. #9
    Join Date
    Jul 2000
    Posts
    147
    You are doing exactly what I ask you not to do....

    Grow up!

  10. #10
    Join Date
    Jan 2001
    Posts
    3,134
    Originally posted by dba_dada
    You are doing exactly what I ask you not to do....

    Grow up!
    I know you are but what am I?
    I remember when this place was cool.

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