in reply to Re^2: Perl DBI '?' substitution with prepare/execute (abstract SQL)
in thread Perl DBI '?' substitution with prepare/execute
What I especially like about SQL::Abstract is that the problem of variable numbers of placeholders is addressed, it's no fun to generate strings like (?,?,?,?) for IN statements.
Hmm, interesting. I'll have to take a closer look at that module. I had previously been building strings like this:
Which is, as you say, tedious.my $insertstring = '['.join('],[', @sqlcolumns).']'; my $valuestring = join(',', map {'?'} @sqlcolumns); my $query = "INSERT INTO table ($insertstring) VALUES ($valuest +ring)";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl DBI '?' substitution with prepare/execute (abstract SQL)
by LanX (Saint) on Apr 18, 2016 at 16:35 UTC | |
by SimonPratt (Friar) on Apr 19, 2016 at 08:17 UTC |