 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
#/usr/bin/perl
-w
|
|
|
### Load
the DBI module
|
|
|
use DBI;
|
|
|
###
Connect to the database
|
|
|
$dbh =
DBI->connect( ‘dbi:Oracle:DEV’, ‘username’, ‘password’ );
|
|
###
Prepare and execute the statement
|
|
|
$sth =
$dbh->prepare( “SELECT name, type FROM megaliths” );
|
|
|
$sth->execute();
|
|
|
### Fetch
the data
|
|
|
while (
( $sitename, $sitetype ) = $sth->fetchrow_array() ) {
|
|
|
print "Megalith site $sitename is
a $sitetype\n";
|
|
|
}
|
|
|
###
Disconnect from the database
|
|
|
$dbh->disconnect();
|
|
|
exit;
|
|