Steffen Goeldner: Today is the 'Day of the Quote' (not to confuse with the 'Quote of the Day'  ;-)
Steffen Goeldner:
Today is the 'Day of the Quote' (not to confuse with the 'Quote of the Day'  ;-)

Running

  use DBI();
  my $dbh = DBI->connect or die "Connect failed: $DBI::errstr\n";
  my $sth = $dbh->prepare("SELECT * FROM env WHERE name = ?");
  $sth->bind_param( 1,'gdk_version');
  $sth->execute;
  $sth->dump_results;

shows

  DBD::monetdb::st execute failed: !ERROR parse error at token (258) in statement: select * from env where name = ''dbi

There are two problems here:

 1) bind_param() quotes the (string representation of the) statement
    handle, not the value:

      $value = $dbh->quote($sth, $type);

 2) execute() quotes the value again:

      my $quoted_param = $dbh->quote($params->[$i]);

I dropped the quoting code from bind_param().

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb