Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to manage sql statements

by adamsj (Hermit)
on Jul 13, 2001 at 07:35 UTC ( [id://96278]=note: print w/replies, xml ) Need Help??


in reply to How to manage sql statements

I'd been thinking about this lately myself, and you've given me the urge to search CPAN and see what's out there.

DBIx::Abstract (there's also a DBIx::AbstractLite out there, which I didn't browse) looks useful and interesting, until you reach Supported DBD Drivers and discover it's been reported to work with mySQL, PostgreSQL, and XBase, and that it should work in a lot of other situations. Sigh--it looks so nice.

Nothing else that I saw looks particularly good, so I've downloaded this and am going to try working with it at home--I'll keep you posted on my adventures. Please do some additional searching in CPAN--I'm willing to give this one a shot, if someone else will look around and see what I've missed.

adamsj

They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

Update: Okay, now I'm thinking DBIx::Abstract maybe isn't worth my efforts, after reading your comments. Does anyone else have suggestions? Or is it time to start rolling our own?

Replies are listed 'Best First'.
Re: Re: How to manage sql statements
by tonyday (Scribe) on Jul 13, 2001 at 10:16 UTC
    I had a good search around a few weeks back and thought that DBIx::Abstract was the best option. However, I found that I was having to bypass the abstraction a lot of the time because my statements were too complex.

    This article is a good example of the type of idea that could be abstracted (even if I don't understand it all). It shows how data manipulations that are quite easy to express end up being fiendishly complicated sql.

    VSarkiss's perlsql hybrid example was the way I expected to write sql when I first started down the perl/sql path. Just hook into a module and say...
    use SQL::GenericStatements qw(count_duplicates, cross_tab); $result = count_duplicates($dbh, $table, @columns); $result = cross_tab($dbh, @tables);
    With VSarkiss's pseudo code under the hood. Another example is the lack of a subselect in mysql. What about a "converter" of sql that overcomes the specific driver limitations.

    Seems like a *lot* of work though...

    tonyday

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://96278]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found