Revision 25198,
805 bytes
checked in by jdreed, 13 years ago
(diff) |
In moira:
* Snapshot moira@r4042 (6/28/11)
* Update version number to include moira revision number
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/moira/bin/perl -Tw |
---|
2 | # $Id: ua-elect.gen 3990 2010-03-11 16:44:43Z zacheiss $ |
---|
3 | |
---|
4 | # The following exit codes are defined and MUST BE CONSISTENT with the |
---|
5 | # error codes the library uses: |
---|
6 | $MR_DBMS_ERR = 47836421; |
---|
7 | $MR_OCONFIG = 47836460; |
---|
8 | |
---|
9 | $outfile = '/moira/dcm/asa-db.out'; |
---|
10 | |
---|
11 | umask 022; |
---|
12 | open(OUT, ">$outfile") || exit $MR_OCONFIG; |
---|
13 | |
---|
14 | use DBI; |
---|
15 | |
---|
16 | $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira") |
---|
17 | || exit $MR_DBMS_ERR; |
---|
18 | |
---|
19 | $sth = $dbh->prepare("SELECT login, clearid, first, last, type FROM users WHERE status = 1 ORDER BY login") |
---|
20 | || exit $MR_DBMS_ERR; |
---|
21 | |
---|
22 | $sth->execute || exit $MR_DBMS_ERR; |
---|
23 | |
---|
24 | while (($login, $clearid, $first, $last, $type) = $sth->fetchrow_array) { |
---|
25 | $row = "$login\t$clearid\t$first\t$last\t$type\n"; |
---|
26 | $row =~ s/\0//g; |
---|
27 | print OUT $row; |
---|
28 | } |
---|
29 | |
---|
30 | close(OUT); |
---|
31 | $dbh->disconnect; |
---|
32 | |
---|
33 | exit 0; |
---|
Note: See
TracBrowser
for help on using the repository browser.