use DBI; $DSN = "dbi:Oracle:host=localhost;sid=essinv;port=1521"; $user = "username"; $pw = "password"; $dbh = DBI->connect($DSN,$user,$pw, { RaiseError => 1, AutoCommit => 1}) || die "Cannot connect: $DBI::errstr\n" unless $dbh; print header (); eval{ $SQL = "INSERT INTO EMPLOYEE ( EMPLOYEE_NUMBER, FIRST_NAME, LAST_NAME, INFORMATION_DATE) VALUES ( ? , ? , ? , SYSDATE)"; $sth = $dbh->prepare($SQL); }; # End of eval # Check for errors. if($@){ $dbh->disconnect; print "Content-type: text/html\n\n"; print "An ERROR occurred! $@\n
"; exit; } else { $sth->execute(param('employee_number'),param('first_name'),param('last_name')); } # End of if..else sub print_output { print <finish; $dbh->disconnect;