in reply to Abstracting sql
What's wrong with having bits of SQL strewn around your code? It seems to be the same as saying that it is messy and wrong to have bits and pieces of regexes left and right in your program and that it would be better to have it abstracted away into some OO-package.
Whatever you do, somewhere in your program you will have SQL-statements to run the queries on your database. Maybe they are hidden inside Class::DBI or someplace else, but they are still there and I like to have them handy nearby so I can tinker with them as necessary. Of course, if you happen to use two times or more very similar SQL in your program, you better turn it into a subroutine which with the use of some well-chosen parameters can go very far in avoiding to having to type (almost) the same SQL-code again and again.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Abstracting sql
by BUU (Prior) on Jul 31, 2003 at 21:53 UTC | |
by mpeppler (Vicar) on Aug 01, 2003 at 06:03 UTC | |
by CountZero (Bishop) on Aug 01, 2003 at 06:52 UTC |