monkers-

over the weekend ilya sterin posted a note to the dbi list requesting comments on the proposed additions to the dbi faq, and suggestions for further additions. the proposed additions can be found here. the current faq, of course, is here

Replies are listed 'Best First'.
Re: dbi faq updates
by gav^ (Curate) on Mar 19, 2002 at 04:23 UTC
    I saw this and thought I'd fire off a couple of answers to questions that have stumped me in the past. Hopefully if more people can post tips then the FAQ can be better for everyone. Here's my contribution here in case it's handy.

    Why does selectall_hashref now fail (changed in 1.20):
    change $hr = $dbh->selectall_hashref($sql, {}, @bind) to $hr = $dbh->selectall_arrayref($sql, {Slice=>{}}, @bind)

    Why does getting values from the CGI.pm param function not work as expected when I insert them into the database?
    CGI.pm returns an empty parameter as an empty string '' so you need to make sure you undef them first!

    How do I use a DSN-less connection with DBD::ODBC?
    Look up the exact name of the driver in ODBC manager for example for Access it is "Access Driver (*.mdb)" and use this string as the DSN:
    $dsn = "driver=$driver;dbq=$path_to_db"; $dbh = DBI->connect("dbi:ODBC:$dsn");

    gav^