note
benizi
<p>Thanks for finding this. As with [id://839894|the other helpful suggestion], it's not really the intended use case (for [cpan://SQL::DB], in this case). But the following hack works:</p>
<code>my $dbh; # connected elsewhere
my $sqlgen = SQL::Abstract->new;
my $sqldb = SQL::DB->new;
$$sqldb{sqldb_dbh} = $dbh; # <- this is why I called it a hack
print $sqldb->query_as_string($sqlgen->insert(atable=>{bar=>1,baz=>undef,foo=>"a string's error"}));
__END__
#prints
INSERT INTO foo ( bar, baz, foo) VALUES ( '1', NULL, 'a string\'s error' )
</code>
839885
840004