snapdragon has asked for the wisdom of the Perl Monks concerning the following question:
I'm currently building a medium scale web application and as much as possible I'm trying to keep everything as discrete objects for obvious reasons. However I'm having some difficulty with the SQL module.
I've written an SQL object that contains SQL with placeholders as class data with a single method (extract) to pull this data out for preparing when neccessary. This is working fine for most cases; however sometimes I have to build dynamic SQL that is formed from user input (checkboxes selected etc). In this case I can't use placeholders because I'm not supplying data to be queried but data definition statements that will be queried apon.
At the moment I've ended up with some hellish SQL hardcoded in some places with loads of conditional statements. Is there a better way of doing this? I've had a peek on CPAN but nothing really fits - DBIx::Abstract seems the closest. Any suggestions monks?
Ta.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: SQL parser from fragments
by talexb (Chancellor) on Apr 18, 2002 at 15:59 UTC | |
Re: SQL parser from fragments
by atcroft (Abbot) on Apr 18, 2002 at 21:33 UTC | |
by samgold (Scribe) on Apr 19, 2002 at 03:38 UTC |