5 ################ THIS RESOURCE IS FOR PINES PRODUCTION
6 my $SOURCE_DBI_RESOURCE = "dbi:Pg:dbname=sparkle;host=10.1.0.12;port=5432";
7 my $SOURCE_DBI_USER = 'postgres';
8 my $SOURCE_DBI_PASSWD = '';
9 my $source_dbh = DBI->connect($SOURCE_DBI_RESOURCE, $SOURCE_DBI_USER, $SOURCE_DBI_PASSWD) or die("Database error: $DBI::errstr");
10 my $primary_fingerprint_tablename = "public.quitman_full_fingerprint_set";
14 my $item_form = shift;
16 my $record_type = shift;
19 my $sql = "select id from $primary_fingerprint_tablename where " . join(' AND ',
20 " item_form = ".$source_dbh->quote($item_form),
21 " substring = ".$source_dbh->quote($date1),
22 " item_type = ".$source_dbh->quote($record_type),
23 " bib_level = ".$source_dbh->quote($bib_lvl),
24 " title = ".$source_dbh->quote($title),
26 my $source_sth = $source_dbh->prepare($sql) or die("prepare error: $DBI::errstr \n[$sql]");
27 $source_sth->execute() or die("execute error: $DBI::errstr \n[$sql]");
29 while ( my ($id) = $source_sth->fetchrow_array ) {
34 $source_sth->finish();
39 while (my $line = <>) {
41 my ($id,$item_form,$date1,$record_type,$bib_lvl,$title) = split(/\t/,$line);
42 if ($id eq 'id') { next; }
43 fetch_record($item_form,$date1,$record_type,$bib_lvl,$title);
46 $source_dbh->disconnect;