#!/usr/bin/perl # Load DBI Module use DBI; use strict; # Setup Connection to Oracle8i my $user = 'scott'; my $password = 'tiger'; my $data_source = 'dbi:Oracle:RAB1'; my $dbh = DBI->connect($data_source, $user, $password) || die "Can't connect to $data_source: $DBI::errstr"; # Here's a complete example program to insert some data from a file # This example uses RaiseError to avoid needing to check each call my $dbh = DBI->connect($data_source, $user, $password, { RaiseError => 1, AutoCommit => 0 }); my $sth = $dbh->prepare( q{ INSERT INTO emp (empno, ename) VALUES (?, ?) }); open FH, ") { chop; my ($empno, $ename) = split /,/; print ("$empno,$ename\n"); $sth->execute($empno, $ename); } close FH; $dbh->commit; $dbh->disconnect;