From 0ef1bd094af3e14b4fa73710812440b14990d4b1 Mon Sep 17 00:00:00 2001 From: tgarip1957 Date: Fri, 19 May 2006 19:16:00 +0000 Subject: [PATCH] Use this script to export all your authorities so that you can build an authority zebra. Use this after marc_into_authority.pl --- misc/exportauth.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 misc/exportauth.pl diff --git a/misc/exportauth.pl b/misc/exportauth.pl new file mode 100644 index 0000000000..868a84dacd --- /dev/null +++ b/misc/exportauth.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl +## This script allows you to export a rel_2_2 bibliographic db in +#MARC21 format from the command line. +# +use HTML::Template; +use strict; +require Exporter; +use C4::Database; +use C4::Auth; +use C4::Interface::CGI::Output; +use C4::Output; # contains gettemplate +use C4::Biblio; +use CGI; +use C4::Auth; +my $outfile = $ARGV[0]; +open(OUT,">$outfile") or die $!; +my $query = new CGI; +my $dbh=DBI->connect("DBI:mysql:database=koha2;host=localhost;port=3306","kohaserver","kohaserver") or die $DBI::errmsg; +#$dbh->do("set character_set_client='latin5'"); +#$dbh->do("set character_set_connection='utf8'"); +#$dbh->do("set character_set_results='latin5'"); +#my $dbh=C4::Context->dbh; + my $sth; + + $sth=$dbh->prepare("select marc from auth_header order by authid"); + $sth->execute(); + + while (my ($marc) = $sth->fetchrow) { + + print OUT $marc; + } +close(OUT); -- 2.39.5