Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: [CDBI] avoiding set_sql() redefinitions

by duct_tape (Hermit)
on Jan 05, 2006 at 16:43 UTC ( [id://521265]=note: print w/replies, xml ) Need Help??


in reply to Re^2: [CDBI] avoiding set_sql() redefinitions
in thread [CDBI] avoiding set_sql() redefinitions

Yes, you can use DBI directly by getting the database handle. This can be done by calling class->db_Main(). You can use it exactly like you would use regular DBI.

sub foo { my $class = shift; my $dbh = $class->db_Main(); my $sth = $dbh->prepare_cached("SELECT ..."); $sth->execute(...); #... usual DBI stuff }

If you then want your return to be objects from the data you retrieved, you may want to look into sth_to_objects() or construct() methods.

Log In?
Username:
Password:

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

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

    No recent polls found