Bug 22509: Add more POD and fix --where

We should not need the "WHERE" keyword to have the same behavior as
existing script (rebuild_zebra.pl)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-05-11 18:53:25 -05:00 committed by Martin Renvoize
parent 7f3c98478a
commit da12cf7551
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,7 @@ if ($verbose) {
say "\t" . $_->as_formatted for @fields_to_add;
}
$where ||= "";
$where = $where ? "WHERE $where" : '';
my $sth =
$dbh->prepare("SELECT biblionumber, frameworkcode FROM biblio $where");
$sth->execute();
@ -94,6 +94,8 @@ add_date_fields_to_marc_records.pl
perl add_date_fields_to_marc_records.pl --field='905$a=0/%Y' --field='905$a=1/%Y/%b-%m' --field='905$a=2/%Y/%b-%m/%d' --unless-exists='905$a' --verbose --confirm
perl add_date_fields_to_marc_records.pl --field='905$a=0/%Y' --field='905$a=1/%Y/%b-%m' --field='905$a=2/%Y/%b-%m/%d' --unless-exists='905$a' --where "biblionumber=42" --verbose --confirm
=head1 DESCRIPTION
Add some MARC fields to bibliographic records.
@ -120,6 +122,8 @@ Confirmation flag, the script will be running in dry-run mode if set not.
Limits the search on bibliographic records with a user-specified WHERE clause.
Only the columns from the biblio table are available.
=item B<--field>
Fields to add to the bibliographic records.