How does one SELECT data from Oracle with DBD::Oracle?
Submitted by admin on Sun, 2005-11-06 02:46.
Look at this example:
my $sql = qq{ SELECT TNAME, TABTYPE FROM TAB }; # Prepare and execute SELECT
my $sth = $dbh->prepare($sql);
$sth->execute();
my($tname, $tabtype); # Declare columns
$sth->bind_columns(undef, $tname, $tabtype);
print "List of tables:nn"; # Fetch rows from DB
while( $sth->fetch() ) {
print "Object: $tname, type: $tabtypen";
}
$sth->finish(); # Close cursor
»
- Login to post comments

