Results 1 to 2 of 2

Thread: ENUM Datatype error

  1. #1
    Join Date
    Jun 2008
    Posts
    121
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default ENUM Datatype error

    hi all

    i have a table name product_table in my database. i want to add a field name "status" in "product_table" after "warranty" field with ENUM datatype values ("Y,"N").
    I m getting the following error when writing in qry in sql field or adding the field by choosing values and datatype manually.

    Code:
    SQL query: 
    
    ALTER TABLE product_table ADD COLUMN status TYPE ENUM( "Y", "N" ) AFTER warranty 
    
    MySQL said:  
    
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE ENUM ("Y", "N") AFTER warranty' at line 1
    Last edited by vineet; 10-23-2008 at 04:17 PM. Reason: resolved

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    try this:

    Code:
    ALTER TABLE `product_table` ADD `status` ENUM( 'Y', 'N' ) AFTER `warranty`;
    Ryan
    Sevierville, TN

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
  •