List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:March 22 1999 9:03pm
Subject:Re: selecting the ENUM values
View as plain text  
On Mon, Mar 22, 1999 at 01:44:53PM -0700, Chris Cochella wrote:
> I am trying to select the list of values and indexes for an ENUM
> datatype.  I am then using this key-value list to populate a pull down.

I did something like this once, and it seemed to work.  Run a query
DESC table_name, then check the type that's returned:

                /^enum\((.*)\)/ and do {
                    my $values = $1;    
                    $values =~ s/^'//;    
                    $values =~ s/'$//;    
                    my @values = split /','/, $values;

                    # now print your dropdown with @values
                };

That's perl, so if you're using another language you'll need to
translate.

Tim
Thread
selecting the ENUM valuesChris Cochella22 Mar
  • Re: selecting the ENUM valuesThimble Smith22 Mar
  • Appending to a SET()Daevid Vincent22 Mar
    • Re: Appending to a SET()Paul DuBois22 Mar
  • Binary type? True/False, Yes/No, On/OffDaevid Vincent23 Mar
    • Re: Binary type? True/False, Yes/No, On/OffMicheal Mc Evoy23 Mar