Tim Bunce wrote:
> 

> p.s. Steffen, any chance you could produce a chunk of code that'll
> connect to a DSN (specified on the command line), query all the
> get_info values and dump the results to stdout as a DBD::<foo>::GetInfo
> module?  Shouldn't be a big modification from the scripts you've
> obviously developed already. It would obviously be a big help
> to many driver authors.

Here is my current test script:

  use DBI();
  use DBI::Const();

  $\ = "\n";
  $, = ": ";

  my $dbh = DBI->connect or die $DBI::errstr;
     $dbh->{ RaiseError } = 1;
     $dbh->{ PrintError } = 1;

  for ( @ARGV ? @ARGV : sort keys %DBI::Const::GetInfo )
  {
    my $Val = $dbh->get_info( $DBI::Const::GetInfo{$_} );
    printf " %-35s%s\n", $_, $Val if defined $Val;
  }

Indeed, a small modification should do it. But

 1) The script dumps if I use DBD::ODBC.
    I think it has to do with:

    /* Fancy logic here to determine if result is a string or int */

    (dbdimp.c) ... 

 2) DBI::Const::GetInfo isn't part of DBI.
    Maybe we give it a second chance as SQL::CLI::GetInfo
    or something like that?


Steffen

Reply via email to