Re: Tiny typo in docs for DBI.parse_dsn()



On Thu, Apr 20, 2006 at 04:45:12PM +1000, Ron Savage wrote:
Hi Tim

Near the end of parse_dsn()'s write up, $driver_dsn should be $driver.

Um, I don't think so:

=item C<parse_dsn>

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn) = DBI->parse_dsn($dsn)
or die "Can't parse DBI DSN '$dsn'";

Breaks apart a DBI Data Source Name (DSN) and returns the individual
parts. If $dsn doesn't contain a valid DSN then parse_dsn() returns
an empty list.

$scheme is the first part of the DSN and is currently always 'dbi'.
$driver is the driver name, possibly defaulted to $ENV{DBI_DRIVER},
and may be undefined. $attr_string is the optional attribute string,
which may be undefined. If $attr_string is true then $attr_hash
is a reference to a hash containing the parsed attribute names and
=> values. $driver_dsn is the last part of the DBI DSN string.

=cut

The existence of $dsn, $driver, and $driver_dsn is a little confusing.

I've changed it to read:

=item C<parse_dsn>

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn) = DBI->parse_dsn($dsn)
or die "Can't parse DBI DSN '$dsn'";

Breaks apart a DBI Data Source Name (DSN) and returns the individual
parts. If $dsn doesn't contain a valid DSN then parse_dsn() returns
an empty list.

$scheme is the first part of the DSN and is currently always 'dbi'.
$driver is the driver name, possibly defaulted to $ENV{DBI_DRIVER},
and may be undefined. $attr_string is the contents of the optional attribute
string, which may be undefined. If $attr_string is not empty then $attr_hash
is a reference to a hash containing the parsed attribute names and values.
$driver_dsn is the last part of the DBI DSN string. For example:

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn)
= DBI->parse_dsn("DBI:MyDriver(RaiseError=>1):db=test;port=42");
$scheme = 'dbi';
$driver = 'MyDriver';
$attr_string = 'RaiseError=>1';
$attr_hash = { 'RaiseError' => '1' };
$driver_dsn = 'db=test;port=42';

=cut

Thanks.

Tim.
.



Relevant Pages

  • Re: Help with Insertdatabase command
    ... When I go into ODBC Data Source Administrator and set up a User DSN, ... the firebird driver I get quite a detailed window headed 'Firebird ODBC Set ... In contrast when i add a File DSN after selecting firebird and then a name ...
    (microsoft.public.word.vba.general)
  • RE: [dbi] DSNs and DRIVER attribute
    ... It fixed all my DSN not found errors. ... the DRIVER attribute. ... > where mydsn is an entry in your unixODBC odbc.ini file defining host, ... >> series of connectivity tests that you can run after running 'make' ...
    (perl.dbi.users)
  • Eureka!
    ... fils dsn, and then connecting througe Excel/MSQuery which seemed to work. ... the firebird driver I get quite a detailed window headed 'Firebird ODBC ... Up which asks for datbase name, driver, client, database account, password ... 'When you click finish you will create the data source which you have just ...
    (microsoft.public.word.vba.general)
  • Re: Access to dbf from Excel (ODBC problem)
    ... You should not use the default name "Visual FoxPro Tables". ... Rename the DSN. ... appropriately DSNs using this driver. ... No DSN using the VFP ODBC driver will work with VFP7 or later versions of ...
    (microsoft.public.fox.programmer.exchange)
  • Re: SQLAllocHandle Errort
    ... > Set DConnect = Server.CreateObject ... > [ODBC Driver Manager] Driver's SQLAllocHandle on ... > I have made the dsn using Microsoft ODBC for Oracle 2.573.9030 ...
    (microsoft.public.inetserver.iis)