Keep It Simple, Stupid | |
PerlMonks |
Re: Handling near-redundant SQL queriesby dragonchild (Archbishop) |
on Sep 01, 2004 at 01:31 UTC ( [id://387371]=note: print w/replies, xml ) | Need Help?? |
I have a module that will construct an SQL query given the following:
It does so by doing the following:
Usage is something like:
Additionally, if you have selectively denormalized your schema for speed purposes, this algorithm would take that into account. (I have, because it's a readonly reporting database. Other possibilities would be for an OLTP database that uses triggers to maintain certain denormalizations.) Is this something that would solve your problem? I haven't released it yet, but could in a week or two. (I planned on doing so anyways, but could do so as early as the end of next week ...) Note: This module doesn't do anything with the database. It's actually a text manipulation module that has some graph theory in the backend. So, it's completely RDBMS-agnostic. And, as you can tell, it produces SQL99-compliant queries. It also supports OUTER JOINs, if needed. I use this module to construct queries for both Oracle9i and MySQL 4.1.x. ------
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose I shouldn't have to say this, but any code, unless otherwise stated, is untested
In Section
Seekers of Perl Wisdom
|
|