in reply to Want DBI to load empty strings as NULL
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Want DBI to load empty strings as NULL
by ikegami (Patriarch) on Feb 14, 2010 at 16:32 UTC | |
by jdrago999 (Pilgrim) on Feb 15, 2010 at 21:40 UTC |