Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Using enum

forums forums SQLyog Using SQLyog Using enum

  • This topic is empty.
Viewing 6 reply threads
  • Author
    Posts
    • #16899
      peterlaursen
      Participant

      this sql should work (it does here)

      create table `test`.`TableName` (`ColumnName` ENUM('Y', 'N') NULL);

      or

      alter table `test`.`TableName1` ,change `ColumnName` `ColumnName` enum ('Y','N') NULL ;

      (or NOT NULL with a default value)

      With the sqlyoug GUI it looks like the image below . Note where to use quotes and not!

      the sql corresponding to the image is

      create table `test`.`enumtest` ( `qwer` enum ('Y','N') DEFAULT 'N' NOT NULL )

    • #16900
      peterlaursen
      Participant

      And note the diffent quotation marks, see image

      alter table `test`.`testtable` ,change `myenumtest` `mynewenumtest` enum ('Y','N') DEFAULT 'N' NOT NULL

    • #16901
      peterlaursen
      Participant

      Sorry – that went wrong , se image

    • #16902
      peterlaursen
      Participant

      this one works too (omitting the ” `” -character)

      alter table test.testtable , change myenumtest myenumtest enum ('Y','N') DEFAULT 'N' NOT NULL

      – but you won't have to worry about that stuff if you use the sqlyog GUI

    • #16903
      peterlaursen
      Participant

      I see now that in my answer 11:42 I mixed up a picture showing an ALTER statement and some SQL containing a CREATE statement. Hope it doesn't confuse too much 😮

      Further more I can tell now that SET variable types are treated just like ENUM's from the sqlyog GUI ….

    • #16904
      peterlaursen
      Participant

      >> Ritesh

      I it could be done it would be nice if the column header “LENGTH” of the CREATE TABLE and ALTER TABLE pane changed to “VALUES” when an ENUM or a SET variable is chosen as datatype. It also is not quite logical that in column LENGTH ” ' ” quotes MUST be given and in DEFAULT colum ” ' ” quotes MAY NOT …

      Just a parsing detail …

      I know people don't use those datatypes very much (but they should!) 😛

    • #16905
      Ritesh
      Member

      Thats a nice suggestion.

      I will forward it to my development team.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.