|
Lines 1-26
Link Here
|
| 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 |
|
| 6 |
use strict; |
| 7 |
|
| 8 |
#use warnings; FIXME - Bug 2505 |
| 9 |
|
| 10 |
use Koha::Script; |
| 11 |
use C4::Context; |
| 12 |
use C4::Auth; |
| 13 |
my $outfile = $ARGV[0]; |
| 14 |
open( my $fh, '>', $outfile ) or die $!; |
| 15 |
my $dbh = C4::Context->dbh; |
| 16 |
|
| 17 |
#$dbh->do("set character_set_client='latin5'"); |
| 18 |
$dbh->do("set character_set_connection='utf8'"); |
| 19 |
|
| 20 |
#$dbh->do("set character_set_results='latin5'"); |
| 21 |
my $sth = $dbh->prepare("select marc from auth_header order by authid"); |
| 22 |
$sth->execute(); |
| 23 |
while ( my ($marc) = $sth->fetchrow ) { |
| 24 |
print $fh $marc; |
| 25 |
} |
| 26 |
close($fh); |
| 27 |
- |