Perl DBI / SQL问题 [英] Perl DBI / SQL Question

查看:62
本文介绍了Perl DBI / SQL问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果交叉发布是不合适的,但我需要帮助这个和

我不确定是否更适合在MySQL或Perl下发帖...我想要

确保我可以从最好的来源获得帮助。


我的问题可能是一个简单的答案,但我不知道我有什么要做什么

和我在这里的书要么没有回答这个问题,要么就是我没有找到答案。


我需要知道如何通过Perl DBI检索字段中可能的ENUM

元素列表,以便在CGI脚本下进行处理。如果我只需要

这是某种形式的SELECT语句,请提供这个

的代码片段,这样我就能做到。


我想制作我的代码所以我不需要编辑硬编码的Perl CGI脚本

如果/当我向ENUM字段添加新元素时。任何帮助,你可以提供

将不胜感激。


谢谢!


Vance

Sorry if the cross-posting wasn''t appropriate, but I need help with this and
am not sure if it''s more appropriate to post under MySQL or Perl...I want to
be sure that I can get help from the best source.

My question is probably a simple answer, but I am not sure what I have to do
and the books I have here are either not answering the question, or I''m not
finding the answer.

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. If all I need for
this is some form of SELECT statement, please provide a code snippet of this
so I can do it.

I want to make my code so I''m not having to edit hard-coded Perl CGI scripts
if/when I add new elements to the ENUM field. Any help you can provide
would be greatly appreciated.

Thanks!

Vance

推荐答案

Vance M. Allen写道:
Vance M. Allen wrote:
如果交叉发布不合适,我很抱歉,但我需要帮助有了这个
并且我不确定在MySQL或Perl下发帖是否更合适...我想确保我可以从最佳来源获得帮助。
<我的问题可能是一个简单的答案,但我不确定我有什么要做的,我在这里的书要么没有回答这个问题,要么我没有找到回答。

我需要知道如何通过Perl DBI检索字段中可能的ENUM
元素列表,以便在CGI脚本下进行处理。如果我只需要
这是某种形式的SELECT语句,请提供一个代码片段,这样我就可以做到。

我想制作我的代码所以我如果/当我向ENUM字段添加新元素时,则不必编辑硬编码的Perl CGI
脚本。非常感谢您提供的任何帮助。

非常感谢!

Vance
Sorry if the cross-posting wasn''t appropriate, but I need help with this
and am not sure if it''s more appropriate to post under MySQL or Perl...I
want to be sure that I can get help from the best source.

My question is probably a simple answer, but I am not sure what I have to
do and the books I have here are either not answering the question, or I''m
not finding the answer.

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. If all I need
for this is some form of SELECT statement, please provide a code snippet
of this so I can do it.

I want to make my code so I''m not having to edit hard-coded Perl CGI
scripts
if/when I add new elements to the ENUM field. Any help you can provide
would be greatly appreciated.

Thanks!

Vance



我不是知道是否有内置的可能会这样做,但它让我想到了b $ b。这是肮脏的事情。


我的


I don''t know if there''s a built-in may of doing this, but it got me
thinking. Here''s a dirty was of doing it.

my


sth =


dbh-> ; prepare(DESCRIBE tablename fieldname);
dbh->prepare("DESCRIBE tablename fieldname");


这篇关于Perl DBI / SQL问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆