Skip to Content.
Sympa Menu

freetds - DBD:Sybase and perl cgi

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Edhi Nugroho" <edhinug AT stmik-stikubank.ac.id>
  • To: <freetds AT franklin.oit.unc.edu>
  • Subject: DBD:Sybase and perl cgi
  • Date: Fri, 7 Jul 2000 16:30:45 +0700


Hi,

I'm using perl 5.002 and DBD:Sybase 0.22.I wrote a test script using Perl to
fetch records from my MSSQL Server (WinNT), its works fine as long as I run
it from command prompt, but when I tried to running as cgi-script I got
message (from my Apache logs) "Exec format". What is that means? I guess
that the err came from line :


DBI->connect("dbi:Sybase:server=192.168.42.2;database=master",'***','****');

FYI, I'm using FreeBSD 2.2.8

What should I do to fix it?

Any ideas/comments are welcome.


TIA
edhinug

Note: all of my cgi scripts are work fine except this script.

#!/usr/local/bin/perl

BEGIN {
$ENV{SYBASE}='/usr/local/freetds';
$ENV{TDSVER}='42';
}

use strict;
use DBI;
#use CGI;

#my $s = new CGI;
#print $s->header;
#print $s->start_html("Test DBI");

print "Context-Type:text/html";
print "<HTML>";
my $dbh =
DBI->connect("dbi:Sybase:server=192.168.42.2;database=master",'***','****');

if (! $dbh) {
print "$DBI::errstr <HTML>";
die("Error");
}
#my $sql = qq{ SELECT kode_jurusan,nama_jurusan from jurusan_tbl };
my $sth = $dbh->prepare("SELECT kode_jurusan, nama_jurusan from
jurusan_tbl");
$sth->execute();

my( $kode_jurusan, $nama_jurusan);
$sth->bind_columns( undef, \$kode_jurusan, \$nama_jurusan);

print "<TABLE>";
while( $sth->fetch() ) {
print "<TR>";
print "<TD>$kode_jurusan</TD>";
}

print "</TABLE>";
$sth->finish();
$dbh->disconnect();
print "</HTML>";







  • DBD:Sybase and perl cgi, Edhi Nugroho, 07/07/2000

Archive powered by MHonArc 2.6.24.

Top of Page