my $dbh = DBI->connect( "dbi:Oracle:host=ortp09-scan;port=1521;service_name=service1", "uname", "pass" , { RaiseError => 1 } ); # $day variable could change..hardcoded for now $day = "Sunday"; my $sth = $dbh->prepare(<execute();