Perl Monk, Perl Meditation | |
PerlMonks |
SQL parser from fragmentsby snapdragon (Monk) |
on Apr 18, 2002 at 15:47 UTC ( [id://160234]=perlquestion: print w/replies, xml ) | Need Help?? |
snapdragon has asked for the wisdom of the Perl Monks concerning the following question:
Afternoon chaps,
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.
Back to
Seekers of Perl Wisdom
|
|