my ($dbh,$sth,$sql); # connect to database $dbh = DBI->connect('DBI:Oracle:mydata') or die "Couldn't connect to database: " . DBI->errstr; # do some stuff to get data into $date and $table_id # insert the days table date and table_id into the index $sql = 'INSERT INTO TableIndex VALUES (?,?)'; $sth = $dbh->prepare($sql) or die "Couldn't prepare SQL\n$sql\n" . $dbh->errstr; $sth->execute($date,$table_id) or die "Couldn't execute SQL\n$sql\n" . $dbh->errstr; $sth->finish; # create a new table to hold the days data $sql =<