use dbi; my $dbh, $sth; my ($sport, $import) = @_; my ($path) = "d:/text/time/" . $sport . ".txt"; open (text, "$path") or die "couldn't open!\n"; my (@text) = ; my $d = $text[0]; my $t = $text[1]; my $a = $text[2]; $dbh = DBI->connect("dbi:ODBC:burlee","spacecitysports","houston34") or die die "Can't open connection\n"; $sth = $dbh->prepare("select * from DATA_DB_ENTRY__ASTROS_STAGING where TS_DATE >= '" . $d . "' and IMPORTACE = '" . $import . "' order by TS_DATE asc, TS_TIME asc "); $sth->execute();