#!/usr/bin/perl -w

BEGIN {
    sub print_help {
    print <<_STR_;
NAME:
    .
SYNOPSIS:
    PERL5LIB=/www/opals/module OPALS_CONF=/etc/opals/conf/\$SITECODE \\
        $0 [param1] [param2] [...]
DESCRIPTION:
    -param1  description 1...
_STR_
    }

    if (!$ENV{'PERL5LIB'} || !$ENV{'OPALS_CONF'}) {
        print_help();
        exit 1;
    }
}

#use Getopt::Std;
#
#my %options = ();
#getopts("c:",\%options);
#my $configFile = $options{c};

use Opals::Context;
use Opals::User qw(
    user_getILLUser
);
use strict;
my $dbh = Opals::Context->dbh();;
END {
    if ($dbh) {
        $dbh->disconnect();
    }
}

$| = 1;
# Codes start...
$dbh->do("alter table opl_ILL_user add  unique LID(lid)");
my $sth=$dbh->prepare("select lid,lName from opl_ILL_user");
$sth->execute();
while(my ($lid,$libName)=$sth->fetchrow_array()){
    my $uid=user_getILLUser($dbh,$lid,$libName);
    print "uid:$uid :: lid:$lid :: library:$libName\n";
}

# Codes end.

exit 0;
################################################################################


#sub {
#}
############################################################
