At 13:54 -0400 10/13/03, Scott R. Godin wrote:
A while back in February, Tim and Ron were discussing DBD::mysql and
column_info..
This is the only thing I could find that *may* relate to my question, so I'm
asking here for further clarification.
It's not clear in the docs (at least not to me) whether I can have
column_info return the possible values of a SET or ENUM column, without
hard-coding them into my scripts.
In other words I'd like my script to be able to tell when the values of the
SET column have changed for the purposes of building an input form via
CGI.pm to allow multiple selects from the input form, and to correctly
display the current selection of SET items.
Before I hare off and write a bunch of testing scripts, I'd just like to
know if I'm on the right track. Will I be able to obtain this information,
and is column_info the right way to do it?
I don't know if column_info can do it, but you don't need to write
the code. Go to http://www.kitebird.com/mysql-perl/ and get the
webdb distribution. The WebDB/TableInfo.pm file in it has a class that
uses SHOW COLUMNS to get the column information and yanks it apart.
Part of the information is the set of SET or ENUM values.
Or, if you want to write the code anyway, this might give you some
ideas.