For MARC 21, instead of deleting the whole subfield when a character does not
[koha.git] / misc / exportauth.pl
1 #!/usr/bin/perl
2 ## This script allows you to export a rel_2_2 bibliographic db in 
3 #MARC21 format from the command line.
4 #
5 use HTML::Template;
6 use strict;
7 require Exporter;
8 use C4::Database;
9 use C4::Auth;
10 use C4::Interface::CGI::Output;
11 use C4::Output;  # contains gettemplate
12 use C4::Biblio;
13 use CGI;
14 use C4::Auth;
15 my $outfile = $ARGV[0];
16 open(OUT,">$outfile") or die $!;
17 my $query = new CGI;
18 my $dbh=DBI->connect("DBI:mysql:database=koha2;host=localhost;port=3306","kohaserver","kohaserver") or die $DBI::errmsg;
19 #$dbh->do("set character_set_client='latin5'"); 
20 #$dbh->do("set character_set_connection='utf8'");
21 #$dbh->do("set character_set_results='latin5'");                
22 #my $dbh=C4::Context->dbh;
23         my $sth;
24         
25                 $sth=$dbh->prepare("select marc from auth_header order by authid");
26                 $sth->execute();
27         
28         while (my ($marc) = $sth->fetchrow) {
29
30                 print OUT $marc;
31         }
32 close(OUT);