Look how simple life is ... with placeholders!
I'm far from an expert when it comes to DB and DBI, but my impression is that most of the 'simplicity' associated with the use of placeholders stems from avoidance of the screaming horrors you will experience in the midst of an SQL injection attack. Almost any syntactic cost would be justified to avoid these terrors, and
$sth->execute( map {$_ ? $_ : undef} @seen_values );
seems quite cheap.
In reply to Re: Want DBI to load empty strings as NULL
by AnomalousMonk
in thread Want DBI to load empty strings as NULL
by Narveson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |