Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by duct_tape (Hermit)
on Jan 05, 2006 at 16:43 UTC ( #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
Node Status?
node history
Node Type: note [id://521265]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2019-09-18 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (219 votes). Check out past polls.

    Notices?