| Author |
RE: Perl DBI / SQL Question
|
|
| Bob Showalter 2005-09-14, 6:55 pm |
| Vance M. Allen wrote:
> I need to know how to retrieve through Perl DBI a listing of possible
> ENUM elements from a field for processing under a CGI script.
Need to know what database you're talking about. This will probably involve
querying data dictionary views or tables. Some DBI drivers also have
specific methods for this kind of thing.
| |
| Vance M. Allen 2005-09-15, 7:55 am |
| I use MySQL 4.1.7 under Fedora Core 3.
Vance
"Bob Showalter" <Bob_Showalter@taylorwhite.com> wrote in message
news:2E4528861499D41199D200A0C9B15BC005E
E808E@fristx.taylorwhite.com...
> Vance M. Allen wrote:
>
> Need to know what database you're talking about. This will probably
> involve
> querying data dictionary views or tables. Some DBI drivers also have
> specific methods for this kind of thing.
>
| |
| Sean Davis 2005-09-15, 7:55 am |
| On 9/14/05 8:32 PM, "Vance M. Allen" <vma_nntp@vmacs.us> wrote:
[color=darkred]
> I use MySQL 4.1.7 under Fedora Core 3.
>
> Vance
>
> "Bob Showalter" <Bob_Showalter@taylorwhite.com> wrote in message
> news:2E4528861499D41199D200A0C9B15BC005E
E808E@fristx.taylorwhite.com...
From the mysql documentation here:
http://dev.mysql.com/doc/mysql/en/enum.html
"f you want to determine all possible values for an ENUM column, use SHOW
COLUMNS FROM tbl_name LIKE enum_col and parse the ENUM definition in the
second column of the output."
You can just do this from DBI and then parse the result.
Hope that gets you what you want.
Sean
|
|
|
|