Sites:
EOF
$sth2 = $dbh->prepare(qq{
select NSS.dbo.SITE.SITE_#, SITE_NAME
FROM NSS.dbo.SITE, NSS.dbo.SITE_CONTACT, NSS.dbo.CONTACT
WHERE NSS.dbo.SITE.SITE_# = NSS.dbo.SITE_CONTACT.SITE_#
AND NSS.dbo.CONTACT.CONTACT_# = NSS.dbo.SITE_CONTACT.CONTACT_#
AND NSS.dbo.CONTACT.CONTACT_# = $in{locateContact}
}) or die "Can't prepare SQL statement: $DBI::errstr\n";
$sth2->execute
or die "Can't execute: $DBI::errstr\n";
my ( $modSiteNumber, $modSiteName);
$sth2->bind_columns (undef, \$modSiteNumber, \$modSiteName);
while ( @row2 = $sth2->fetchrow() )
{
print "$modSiteName ";
}
$sth3 = $dbh->prepare(qq{
select SITE_#, SITE_NAME
FROM NSS.dbo.SITE
WHERE SITE_# NOT IN
(select NSS.dbo.SITE.SITE_#
FROM NSS.dbo.SITE, NSS.dbo.SITE_CONTACT, NSS.dbo.CONTACT
WHERE NSS.dbo.SITE.SITE_# = NSS.dbo.SITE_CONTACT.SITE_#
AND NSS.dbo.CONTACT.CONTACT_# = NSS.dbo.SITE_CONTACT.CONTACT_#
AND NSS.dbo.CONTACT.CONTACT_# = $in{locateContact})
}) or die "Can't prepare SQL statement: $DBI::errstr\n";
$sth3->execute
or die "Can't execute: $DBI::errstr\n";
my ($newSiteNumber, $newSiteName);
$sth3->bind_columns (undef, \$newSiteNumber, \$newSiteName);
while ( @row3 = $sth3->fetchrow())
{
print "$newSiteName ";
}
print <<"EOD";
|