Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to manage sql statements

by agoth (Chaplain)
on Jul 13, 2001 at 15:15 UTC ( [id://96347]=note: print w/replies, xml ) Need Help??


in reply to How to manage sql statements

A while ago I went for a package with all the SQL in and an abstraction layer, CRDB which sits on top of DBI, takes a statement title and returns the results.
Works quite well for a system that doesnt have masses of SQL.
package CRSql; use strict; use vars qw ( %SQL ) ; %SQL = ( sys => q{ select count(*) from user_tables }, donation_count => q{ select count(*) from donation }, ); #------------------------------------ use CRSql; use CRDB; my $crdbh = CRDB->login('****', '****', '****', $FALSE); Log::write('FATAL', "DB connection failed \n") unless (ref($crdbh) eq +'CRDB'); $crdbh->sql(\%CRSql::SQL); my ($cols, $ref) = $crdbh->as_list('donation_count', 'A');

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-29 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found