Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    13

    Unanswered: add new field between existing fields??

    I know how to add a new field but my trouble is, how would I put in between 2 other existing fields. Currently my shipping table is

    table: shipping

    fields
    SHIPID, NOT NULL, NUMBER(5)
    INVID, NOT NULL, NUMBER(5)
    DATE_EXPECTED, NOT NULL, DATE
    DATE_RECIEVED, DATE
    QUANTITY_RECIEVED, NUMBER(5)

    I want to add a field called quantity_expected and place it in between date_expected and date_recieved. So far I'm stuck the following

    ALTER TABLE shipping
    ADD (quantity_expected NUMBER(5) CONSTRAINT shipping_quantity_expected_nn NOT NULL);

  2. #2
    Join Date
    May 2003
    Posts
    87

    Re: add new field between existing fields??

    May I ask why does the order of columns matter ?

    If you insist, there are couple of ways :
    1. Rename this table to shipping_old
    2. Create a view called as shipping with whatever order of columns you want.
    Or
    2. Create new table as :
    create table shipping as select <columns_in_proper_order> from shipping_old;

    Hope this helps !!

    Originally posted by MaxPlus
    I know how to add a new field but my trouble is, how would I put in between 2 other existing fields. Currently my shipping table is

    table: shipping

    fields
    SHIPID, NOT NULL, NUMBER(5)
    INVID, NOT NULL, NUMBER(5)
    DATE_EXPECTED, NOT NULL, DATE
    DATE_RECIEVED, DATE
    QUANTITY_RECIEVED, NUMBER(5)

    I want to add a field called quantity_expected and place it in between date_expected and date_recieved. So far I'm stuck the following

    ALTER TABLE shipping
    ADD (quantity_expected NUMBER(5) CONSTRAINT shipping_quantity_expected_nn NOT NULL);

Posting Permissions

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