SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How add a new ENUM value to a ENUM set.

    Hi all,

    I already have a ENUM column setup that contains the following values, 'Pending', 'Outstanding', 'Completed', 'Refunded', 'Failed'.

    I now need to add a new value into the ENUM set ('Awaiting' being the new value I need to add). How exactly do I do this? I have search online, but haven't really found a definte way of doing this. From what I have gathered, is the following correct?
    Code:
    ALTER TABLE orders
    MODIFY status ENUM('Pending', 'Outstanding', 'Completed', 'Refunded', 'Failed', 'Awaiting')
    Thanks

    Tryst

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    That should work. Back up the database and try it out, I am fairly sure that will work.

  3. #3
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done it, and everything seems ok.

    Tryst

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    would've been a simple insert if you were using a Status table

    (i am staunchly anti-enum)

    just curious, what's the difference between 'Pending', 'Awaiting', and 'Outstanding'?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha! Exactly what I was thinking when looking for a solution, r937.

    just curious, what's the difference between 'Pending', 'Awaiting', and 'Outstanding'?
    Pending and Awaiting are two status types a customer order can be in. I was having problems with Paypals IPN and had to set it up this way (long story ).

    The 'Awaiting' value is actually Awaiting Stock. I will make the live site to reflect this.

    Tryst


Bookmarks

Posting Permissions

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