List:MySQL++« Previous MessageNext Message »
From:Andrew Sayers Date:July 18 2007 11:55pm
Subject:Re: How to retrieve ENUM values by INDEX
View as plain text  
From http://dev.mysql.com/doc/refman/4.1/en/enum.html:

	If you retrieve an ENUM value in a numeric context, the column
	value's index is returned. For example, you can retrieve numeric
	values from an ENUM column like this: 

	mysql> SELECT enum_col+0 FROM tbl_name;

So the easiest solution is to change your query to 
"SELECT StudentID, StudentClub+0 FROM students" (note: the trailing ";"
isn't necessary either).

I doubt there's a mysql++-specific solution for this (although others
know far more than me), because mysql++ isn't given any information
about the mappings between ENUM names and numbers.

	- Andrew
Thread
How to retrieve ENUM values by INDEXZeddy Chirombe19 Jul
  • Re: How to retrieve ENUM values by INDEXWarren Young19 Jul
  • Re: How to retrieve ENUM values by INDEXAndrew Sayers19 Jul
    • Re: How to retrieve ENUM values by INDEXZeddy Chirombe19 Jul
      • Re: How to retrieve ENUM values by INDEXWarren Young20 Jul
        • Re: How to retrieve ENUM values by INDEXZeddy Chirombe20 Jul