in reply to Re: What do people want from DB abstraction modules?
in thread What do people want from DB abstraction modules?

In DBI, to get a row of data using a primary key for the bind variable, I need to create a statement handler, bind a parameter, execute, and return some structure. 4 lines of code
Or one line: my @row = $dbh->selectrow_array($sql,{},$key);
Cross DB support. Ever need to join two tables aross do different databases?
DBD::AnyData can make that pretty simple for some queries:
my $data = $dbh->selectrow_array( "SELECT $cols FROM IMPORT(?) JOIN IMPORT(?) ON(...", {}, $postgresql_sth, $mysql_sth );

Replies are listed 'Best First'.
Re^3: What do people want from DB abstraction modules?
by exussum0 (Vicar) on Jan 05, 2006 at 20:03 UTC
    Or one line: my @row = $dbh->selectrow_array($sql,{},$key);
    Never noticed that before on the $dbh object. But more of those types of things are useful.
    my $data = $dbh->selectrow_array( "SELECT $cols FROM IMPORT(?) JOIN IMPORT(?) ON(...", {}, $postgresql_sth, $mysql_sth );
    I kinda like that. The funky IMPORT(?) doesn't seem standard, but something more "SELECT * FROM $dbh1 A, $dbh2 B where b.something = a.something" seems more natural. In some databases, I frequently do, "
    SELECT * FROM ( SELECT * FROM A WHERE A.something = 1 ) AA, ( SELECT * FROM B WHERE B.something = 2) BB WHERE AA.bob = BB.bob
    nitpick pick pick :)

    ----
    Give me strength for today.. I will not talk it away..
    Just for a moment.. It will burn through the clouds.. and shine down on me.