List:MySQL++« Previous MessageNext Message »
From:Zeddy Chirombe Date:July 18 2007 11:30pm
Subject:How to retrieve ENUM values by INDEX
View as plain text  
All,

I have question. Here is the scenario:

CREATE TABLE students(
        StudentID int(11) unsigned zerofill not null auto_increment,
        StudentClub enum('Soccor','Music','ACM','BoyScouts') not null
)
INSET INTO TABLE students(StudentClub) VALUES(3);

query << "SELECT * FROM students;";
Result res = query.store();
Row row = res.fetch_row();
unsigned long std_id = row.raw_data(0);
int std_club =  ??? row.raw_data(1); ???
So, in red is the question - I need to extract/return the ENUM index, not
the ENUM string value. How do we do this -

--Thanks in advance for helping out.
--Zeddy

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