Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Sybase(on WinXPProfessional) connectivity with Perl(Sybase 15, Perl5.8.8)

by MH (Initiate)
on Jan 02, 2007 at 08:00 UTC ( [id://592505]=perlquestion: print w/replies, xml ) Need Help??

MH has asked for the wisdom of the Perl Monks concerning the following question:

My Respect to all the Monks.
I am trying to connect Sybase 15Dev Edition to Perl v5.8.8. I have installed the DBI module from PPM.
Tried a simple sample program (The code is attached below) and I get the error enclosed in <Error> and </Error>:
<Error>
install_driver(Sybase) failed: Can't locate loadable object for module + DBD::Sybase in @INC (@INC contains: C:/Perl/site/lib C:/OTRS/Perl/si +te/lib C:/OTRS/Perl/l ib .) at (eval 4) line 3 Compilation failed in require at (eval 4) line 3. Perhaps a module that DBD::Sybase requires hasn't been fully installed at P2.pl line 10
</Error>
Program Code:
-------------
#!C:/Perl/bin -w use lib 'C:/Perl/site/lib'; use MIME::Base64; use DBI; $user = "sa"; $password = "abc123"; $dbh = DBI->connect ("dbi:Sybase:server=PUNDTGYDNB1S",$user, $password) or die "Cannot Con +nect"; $dbh->do("use pubs2"); my $SQL = "SELECT * FROM authors"; print "The query returns the following list of authors:\n"; while ($connection->FetchRow()) { ## Translate the row into something usable. In this case I am chan +ging ## to a hash so I can use key names (CustomerID, CompanyName) rath +er than ## integer values (0, 1). If I wanted to use integer values, I'd u +se the ## Data() method instead of the DataHash() method. my %dataRow = $connection->DataHash(); # print $dataRow{CustomerID} . " : " . $dataRow{CompanyName} . "\n" +; print $dataRow{au_id} . " : " . $dataRow{au_lname} . "\n"; } ## Closing the database connection $connection->Close();
-----------------------------------------
Can I have some help as regards how to access Sybase on Windows XP Professional from Perl 5.8.8, please?
Kind Regards.

Replies are listed 'Best First'.
Re: Sybase(on WinXPProfessional) connectivity with Perl(Sybase 15, Perl5.8.8)
by rinceWind (Monsignor) on Jan 02, 2007 at 10:44 UTC

    Have you installed DBD::Sybase? If you don't have this module installed, I would expect the diagnostics you are seeing.

    DBD::Sybase does contain XS code, so you'll need a C compiler, unless you can find a PPM for it - I don't think this one is on ActiveState, but bribes.org or CrazyInsomniac might be able to get you one.

    As an alternative, if you can't get DBD::Sybase working, there's always ODBC.

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

Re: Sybase(on WinXPProfessional) connectivity with Perl(Sybase 15, Perl5.8.8)
by jfroebe (Parson) on Jan 02, 2007 at 13:56 UTC
Re: Sybase(on WinXPProfessional) connectivity with Perl(Sybase 15, Perl5.8.8)
by chanakya (Friar) on Jan 02, 2007 at 09:02 UTC
    MH

    Try adding a BEGIN block and add Sybase path as shown below.
    #!/usr/bin/perl use warnings; use strict; BEGIN { $ENV{SYBASE} = 'C:\\sybase'; } use DBI; ... ...
    Check the "Connecting to Sybase" section in the DBD::Sybase for more details.
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://592505]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found