$dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
|| exit $MR_DBMS_ERR;
-$sth = $dbh->prepare("SELECT p.name, m.name, p.location FROM printers p, ".
+$sth = $dbh->prepare("SELECT m.name FROM printers p, ".
"machine m WHERE p.type = 'SAP' AND p.mach_id = ".
- "m.mach_id ORDER BY p.name") || exit $MR_DBMS_ERR;
+ "m.mach_id ORDER BY m.name") || exit $MR_DBMS_ERR;
$sth->execute || exit $MR_DBMS_ERR;
umask 022;
open(OUT, ">$outfile") || exit $MR_OCONFIG;
+print OUT "# This File is automatically generated by Moira. Do not edit.\n";
-while (($name, $hostname, $location) = $sth->fetchrow_array) {
+while (($hostname) = $sth->fetchrow_array) {
next if $hostname eq "[NONE]";
- $row = "$name\t$hostname\t$location\n";
+ $row = "$hostname\n";
$row =~ s/\0//g;
print OUT $row;
}