Subject | Perl script to connect to a remote IB on windows from linux |
---|---|
Author | Danial Magid |
Post date | 2001-10-04T18:15:28Z |
Hi,
I am trying to run a perl script that will access Interbase locate on a
Windows machine from a linux machine.
My script is giving my some trouble? Any help will be appreciated.
This is what I have so far..
#!/usr/bin/perl
use DBI;
$host = "db.danialmagid.com";
$db = "c:\\msasdata\\mmpcs.dgb";
%attr = (
database => "c:\\msasdata\\mmpcs.dgb"
);
$dbh = DBI->connect("dbi:InterBase:host=$host", "SYSDBA", "masterkey",
\%attr) || die $DBI::errstr;
$query="SELECT address1, address2 FROM CUSTOMER";
$sth=$dbh->prepare($query);
$sth->execute();
$sth->bind_col(1,\$address1);
$nr = $sth->rows;
print $nr;
if ($sth->rows) {
$sth->fetch;
}
Where am I going wrong?
I have the DBD and DBI installed.. Do I need to install IBPerl?
Thanks,
Danial
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
I am trying to run a perl script that will access Interbase locate on a
Windows machine from a linux machine.
My script is giving my some trouble? Any help will be appreciated.
This is what I have so far..
#!/usr/bin/perl
use DBI;
$host = "db.danialmagid.com";
$db = "c:\\msasdata\\mmpcs.dgb";
%attr = (
database => "c:\\msasdata\\mmpcs.dgb"
);
$dbh = DBI->connect("dbi:InterBase:host=$host", "SYSDBA", "masterkey",
\%attr) || die $DBI::errstr;
$query="SELECT address1, address2 FROM CUSTOMER";
$sth=$dbh->prepare($query);
$sth->execute();
$sth->bind_col(1,\$address1);
$nr = $sth->rows;
print $nr;
if ($sth->rows) {
$sth->fetch;
}
Where am I going wrong?
I have the DBD and DBI installed.. Do I need to install IBPerl?
Thanks,
Danial
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1