use strict; use DBI; use DBD::Oracle qw(:ora_types); # Connect as Oracle $ENV{ORACLE_HOME}='/users/oracle/OraHome1'; my $dbh=DBI->connect("dbi:Oracle:MyDatabase","username","password"); # Select the some columns from the database my $sth = $dbh->prepare("select a as Alias, b as Bob from MyTable where c=?"); $sth->execute("Some Value"); # One convenient method is to use a hash reference while (my $res = $sth->fetchrow_hashref()) { # You can refer to values using the name of the column/alias # for example... my $alias = $res->{Alias}; my $bob = $res->{Bob}; .... } $sth->finish; $dbh->disconnect();