5 # The following exit codes are defined and MUST BE CONSISTENT with the
6 # error codes the library uses:
7 $MR_DBMS_ERR = 47836421;
8 $MR_OCONFIG = 47836460;
10 $outfile = '/moira/dcm/longjobs.out';
14 $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
17 $sth = $dbh->prepare("SELECT name FROM list WHERE grouplist = 1")
20 $sth->execute || exit $MR_DBMS_ERR;
23 open(OUT, ">$outfile") || exit $MR_OCONFIG;
25 while ($name = $sth->fetchrow_array) {
27 $sth2 = $dbh->prepare("SELECT UNIQUE u.login FROM users u, imembers i, " .
28 "list l WHERE l.name = " . $dbh->quote($name) .
29 "AND l.list_id = i.list_id " .
30 "AND i.member_type = 'USER' " .
31 "AND i.member_id = u.users_id") || exit $MR_DBMS_ERR;
33 $sth2->execute || exit $MR_DBMS_ERR;
40 while ($member = $sth2->fetchrow_array) {
41 $row = "$maybecomma$member";