Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If performance isnt an issue, one trick i use is to read the sql in from a file. another trick i use to line up my sql and make it look nice in the code (when i embed it) is concatenation my $sql .= "rest of statement"I also package up my dbi stuff into a couple of subbies, one for selecting, and one for insert, update, delete, and do all the appropriate error checking (ie DB alive, uname/pwd ok et al). I also pass all the params as anon hashes. Its not amazing code, buts its functional, and works for me. It also means, once i've written my dbi subbies, i dont need to go about writing dbi stuff again, just remember the parameters that must be parsed.. :-) In reply to Re: dbi style questions (code, discussion)
by Ryszard
|
|