#!/usr/bin/env perl use warnings; use strict; use DBI; my $dbuser = 'bla'; my $pass = 'bla'; my $table = 'v$log,v$logfile'; my $columns = 'v$logfile.member'; my $statment="SELECT v\$logfile.member FROM v\$log, v\$logfile WHERE v\$log.group# = v\$logfile.group#;"; # connect to the database my $dbh = DBI->connect("dbi:Oracle:host=some_hostname;sid=MCDB", $dbuser, $pass) or die "Cant connect to : $DBI::errstr\n"; # select entries in the database my $sth = $dbh->prepare('SELECT v$logfile.member FROM v\$log, v$logfile WHERE v$log.group# = v$logfile.group#;'); # execute the select statement $sth->execute; my @data = $sth->fetchrow_array(); foreach my $x (@data) { print "$x \n"; } # end the reading of results #$sth->finish; # disconnect from the database $dbh->disconnect;