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