[OPEN-ILS-GENERAL] EG 2.0: problem Marc2bre - Global Flags "Maintain 001-003-035 according MARC" and "TCN=Internal ID"

Dan Scott dan at coffeecode.net
Fri Mar 4 22:57:31 EST 2011


On Fri, Mar 04, 2011 at 10:00:02PM +0100, Repke de Vries wrote:
> Apologies Dan for the long gap discussing this - and thanks for your fix (part of the 2.0.2 release) that makes the Global Flag "Cat: Use internal ID for TCN value"  when set to TRUE, have the same effect for command line importing bib records as it already had  for importing through the GUI. 
> 
> However:  also the other Global Flag "Maintain 001-003-035 according MARC"  when set to TRUE,  behaves differently when importing bib records from the command line then through the GUI:
> 
> - through the GUI  the Control Number in the imported bib record's 001 field gets pushed to the 035 as expected and the 001 receives the Evergreen Internal Record ID etc.; and because of the Global Flag "Cat: Use Internal ID for TCN Value" the TCN follows this Internal Record ID 
> - importing from the command line the Global Flag setting is ignored however and the Control Number in the imported bib record's 001 field becomes the new Evergreen Record ID;  the TCN also ignores it's Global Flag Setting -  this latter behaviour has been fixed now (as I understand it)

I think there's a misunderstanding here. The --idfield parameter says
"Set the internal record ID to the value of (whatever field --idfield
points to)" - which describes the behaviour you're seeing, I think.

If you want to disregard the existing 001 value in the records that
you're importing, and just use whatever Evergreen gives you, you can
import your records as follows:

marc2bre.pl input.mrc | pg_loader.pl -or bre -a bre

If you're importing from MARC21XML, you'll need to add the "--marctype
XML" flag to marc2bre.pl, but you have that part sorted out already.
Just drop the --idfield (and --idsubfield) flags entirely if you don't
care about them. The part to focus on is the "-a bre" flag from
pg_loader.pl; it says "let the database assign a value for this object".
So pg_loader.pl doesn't assign any value to the "id" column of
biblio.record_entry, in this case; the column isn't specified in the
COPY command and the database automatically assigns the next value in
its sequence for the biblio.record_entry.id column. And that, in turn,
will ensure that the 001 gets populated with that record ID and the old
001 gets pushed to the 035, etc.

I think that's what you're looking for?


More information about the Open-ils-general mailing list