2 ms·
"just" use concat or similar (depending on your database flavour) with "?": #!/usr/bin/env perl use 5.020_000; use warnings; use DBI qw<>;
by mfontani 4y ago
"just" use concat or similar (depending on your database flavour) with "?":
#!/usr/bin/env perl
use 5.020_000;
use warnings;
use DBI qw<>;
my $dbh = DBI->connect('dbi:SQLite:dbname=:memory:');
my $sth = $dbh->prepare('SELECT ("quux-" || ?) AS foo');
$sth->execute('bar');
say $sth->fetchrow_hashref->{foo};
... gives:
$ perl c.pl
quux-bar