Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I'm adding a field to Louisa:titles to indicate that the data has been copied to folio:marcRecords : Louisa:titles.copied (Y or NULL)

Louisa2folio.pl is pretty simple:

#! /usr/bin/perl
use DBI;
$dbf = DBI->connect("DBI:mysql:database=folio;host=localhost","perl","t0k3n") or error_exit($DBI::errstr);
$dbl = DBI->connect("DBI:mysql:database=Louisa;host=localhost","perl","t0k3n") or error_exit($DBI::errstr);
for ($x = 0; $x < 240174; $x++) {
$select = $dbl->prepare("select mrc,ckey,createDate,titleID from titles where copied is null limit 1"); $select->execute();
while (@result = $select->fetchrow()) {
$mrc = "$result[0]"; $ckey = "$result[1]"; $createDate = "$result[2]"; $titleID = "$result[3]";
$createDate =~ s/-//g;
print "$x $titleID $ckey $createDate \n";
}
$select->finish();
$insert = $dbf->prepare("insert into marcRecords (marc,catalogedDate,catalogKey) values (?,?,?)");
$insert->execute($mrc,$createDate,$ckey);
$insert->finish();
$update = $dbl->prepare("update titles set copied=? where titleID=?");
$update->execute('Y',$titleID);
$update->finish();
}
$dbl->disconnect();
$dbf->disconnect();

Only 193,522 of Louisa's 240,175 titles had catalogKeys which suggests that the other 46,653 are eBooks. It wouldn't hurt to investigate that further, later.

Next up: make a copy of bibLoad.pl and tweak it to look to Louisa's items table for all of that 999 infoOnce those 240,??? Louisa titles are loaded into the marcRecords table then I can see about tweaking the bibLoad.pl script to load them into FOLIO...