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

Re^2: STATEMENT HANDLES

by opensourcer (Monk)
on Nov 22, 2006 at 06:39 UTC ( #585448=note: print w/ replies, xml ) Need Help??


in reply to Re: statement handles (dbi)
in thread statement handles (dbi)

use DBmanager qw ($dbh $table); sub tableinfo { my ($dbh, $table) = @_; $table = "download"; my $sth = $dbh->prepare("QUERY"); my $tables = $sth->{'NUM_OF_FIELDS'}; print Dumper($tables); } &tableinfo ($dbh, $table);
output : $VAR1 = undef;
may be im doing somewhere wrong, i hoping for an sample code.


Comment on Re^2: STATEMENT HANDLES
Download Code
Re^3: statement handles (dbi)
by chargrill (Parson) on Nov 22, 2006 at 07:28 UTC

    What's "DBmanager"?

    I'm used to seeing database code like this (for mysql):

    use DBI; my $dbh = DBI->connect( "DBI:mysql:database=test;host=localhost", "username", "password" ); my $sth = $dbh->prepare( 'select * from table_foo' ); $sth->execute(); my $numrecords = $sth->rows; my $numfields = $sth->{'NUM_OF_FIELDS'}; $sth->finish; print "I found $numrecords records, each having $numfields fields.\n";

    Please note, I took this example code directly from the documentation. It makes sense to me - is there something you have a question about that the documentation doesn't answer?



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-11-28 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (193 votes), past polls