8 BEGIN { binmode STDOUT, ":utf8"; }
10 my $DB = DBI->connect("dbi:Pg:host=roadstar", "", "",
11 { AutoCommit => 0, RaiseError => 1 });
13 my $st = $DB->prepare("SELECT title, ndisc, path FROM old_dvd ORDER BY title");
16 my $st1 = $DB->prepare("INSERT INTO dvd (title, disc, path) VALUES (?, ?, ?)");
18 my @r = $st->fetchrow_array; last ROW unless @r;
19 my ($title, $ndisc, $path) = @r;
20 print ";; $title [$ndisc]\n";
21 for (my $i = 0; $i < $ndisc; $i++) { $st1->execute($title, $i, $path); }
23 $DB->commit; $DB->disconnect;