Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Problems with DBD::Sybase on Win2K

by Wookie (Beadle)
on May 21, 2002 at 14:00 UTC ( [id://168127]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,

I am having problems getting DBD::Sybase version 0.91 working with perl 5.61 build 630 on Windows 2000. The error is below and looks to be an envirmoment issue - but I am using the code also given below, to ensure that $SYBASE is set correctly.

CODE:
use strict; use DBI; BEGIN { $ENV{SYBASE}='c:\sybase' } print "$ENV{SYBASE}\n"; my $dbh=DBI->connect('DBI:Sybase:server:FOOBAR','foo','bar'); use Data::Dumper; print Dumper($dbh); exit(0);
ERROR:
perl test.pl c:\sybase install_driver(Sybase) failed: DBD::Sybase initialize: cs_ctx_alloc() +failed at C:/Perl/lib/DynaLoader.pm line 225. Compilation failed in require at (eval 1) line 3. at test.pl line 11
I was wondering if anyone else is using this successfully - or knows of any issues before I go down the dark path of manually compiling DBD::Sybase
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Replies are listed 'Best First'.
Re: Problems with DBD::Sybase on Win2K
by mpeppler (Vicar) on May 21, 2002 at 14:25 UTC
    Which version of Sybase do you have installed?

    Sybase's OpenClient is pretty sensitive to having the right files in the places where it expects them. cs_ctx_alloc() will fail if (for example) appropriate locale files aren't found, or if the installed version of Sybase client libraries is much older than that used to build DBD::Sybase.

    Michael

      Sybase 11.0

      Don't know how significant it may be (not knowing a lot about locales for Sybase) - but the only sub folder of the c:\sybase\locales folder is English.

      It has CP437, CP850, ISO_1, MAC and ROMAN8 as sub folders.
      game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);
        Unfortunately I don't know all that much about Windows systems...

        Maybe you should ask on the dbi-users or sybperl-l mailing lists? (The sybperl-l mailing list is specifically for Sybase + Perl issues, subscribe at listproc@list.cren.net, with subscribe sybperl-l in the body of the message)

        Michael

Re: Problems with DBD::Sybase on Win2K
by VSarkiss (Monsignor) on May 21, 2002 at 15:17 UTC

    This may be just a copy-and-paste artifact, but the first parameter in your connect should be: my $dbh=DBI->connect('DBI:Sybase:server=FOOBAR','foo','bar');In other words, the server name should be separated by an equal sign, not a colon.

Re: Problems with DBD::Sybase on Win2K
by busunsl (Vicar) on May 29, 2002 at 09:28 UTC
    I once had problems with setting the $SYBASE variable in a BEGIN block. DBD::Sybase just ignored it.

    The only way to solve the issue was by setting the $SYBASE variable globally.

Re: Problems with DBD::Sybase on Win2K
by Wookie (Beadle) on Jun 05, 2002 at 12:26 UTC
    Update:

    Got it working by compiling DBD::Sybase from source.

    Had to make the addition below to the dbdimp.h:
    #ifndef strncasecmp #define strncasecmp strnicmp #endif

    game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2025-03-18 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (56 votes). Check out past polls.