#!/usr/bin/perl -w
use DBI;

$dbh = DBI->connect("DBI:mysql:nations", "randy", "password");
$dbh->do("drop table myborders;");
$dbh->do("create table myborders (Code1 char(2) not null, Code2 char(2) not null, Length Decimal(30,2));") || die "Unable to create table";
$sth = $dbh->prepare("SELECT * FROM borders;");
$sth->execute();
while (@row = $sth->fetchrow_array()) {
   $dbh->do("INSERT INTO myborders values ('$row[0]','$row[1]','$row[2]');");
}
$dbh->disconnect;
exit;
