#!/usr/bin/perl
use DBI;
$tns="cuug";
$user="scott";
$passwd="oracle";
$dbh = DBI->connect("dbi:Oracle:$tns","$user","$passwd") or die "can't connect to database ". DBI-errstr;
$sth=$dbh->prepare("select * from emp");
$sth->execute;
while (@recs=$sth->fetchrow_array) {
print $recs[0].":".$recs[1]."\n";
}
$dbh->disconnect;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-753364/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27042095/viewspace-753364/