On Thu, Jul 27, 2000 at 10:16:41AM +0300, Miki Shapiro wrote:
> Can anyone reccomend something (preferrably that is installed with a stock
> SuSE distro :-)) that can interact with MSSQL and generate nifty, 
> parsable, textual and listar-readable lists of email addresses with
> minimum fuss?

The database query itself is simple enough: it will look something
like:

    SELECT email FROM MAILINGLIST WHERE listname = 'YOURLISTNAME';

(Assuming one table may hold information for more than one list.)

The bigger problem is getting something on linux to connect to your
database. I never did this myslef, but Perl DBI with DBD::ODBC is
reported to work. You will need an ODBC driver, too: the DBD::ODBC
documentation points at http://www.openlinksw.com/ and at
http://www.intersolv.com/ as possible sources. In addition, you will
need and ODBC driver manager; one is bundled with DBD::ODBC but there
are several to chose from.

I expect your code itself to be very simple. Installation issues are
your main concern here (if anyone has experience in installing these,
please do tell). Here's an untested example of the code:

==
use DBI;
$dbh = DBI->connect('dbi:ODBC:DSN', 'user', 'password');

$query = $dbh->prepare("SELECT # etc., as above... ");
$query->execute();

while ($h = $query->fetchrow_hashref()) {   # I never use fetchrow_array
    print $h->{EMAIL}, "\n";
}

END { $dbh->disconnect() if defined $dbh }
==

(I'd like to know if this driver works for you, btw.)

-- 
believing is seeing
[EMAIL PROTECTED]
http://www.forum2.org/gaal/

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to