#!/usr/bin/perl -w use DBI; use DBD::Oracle qw(:ora_types); use Carp; use strict; my $dbh = DBI->connect( 'dbi:Oracle:prod_01', $ENV{PROD_DB_USER}, $ENV{PROD_DB_PASS} ) or croak "Unable to connect: $DBI::errstr"; my $sth = $dbh->prepare( "select * from prod.t_connection_ports order by client_id" ); $sth->execute; printf( "\n%-15s %10s %10s %10s %-30s \n\n", "Client","Port","Client ID","Status","Machine ID"); while ( my $row = $sth->fetchrow_arrayref ) { printf( "%-15s %10s %10s %10s %-30s \n", @$row[3],@$row[2],@$row[0],@$row[4],@$row[1]); }