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

Hi,I want to access sybase database using Perl. Saw most related earlier posts here.Thought of using DBD::Sybase,is it necessary to install 'sybperl'.I do not think so.What are the prerequites for DBD::Sybase?

While installing DBD::Sybase,I am getting error as 'Please set SYBASE in CONFIG, or set the $SYBASE environment variable at Makefile.PL'.echo $SYBASE shows /usr/local/lib/sybase

I am confused regarding SYBASE and LD_LIBRARY_PATH variables as WHICH address to give in both(I am having sybase database on my remote server,so where SYBASE should point to).I am using linux machine.Sorry for such basic doubts,but help will be really appreciable :)

Replies are listed 'Best First'.
Re: perl+sybase connection
by roboticus (Chancellor) on Jul 06, 2010 at 14:20 UTC

    HimanshuP:

    You'll need the Sybase client libraries on the machine, and the SYBASE environment variable needs to specify the path to them so that the DBD::Sybase package can be built and linked. The DBD::Sybase documentation gives the path '/usr/local/sybase' as an example location. If you're installing on a machine that doesn't have the Sybase libraries on it, then you can download them (when I last checked, a few years ago) from the Sybase site.

    I just checked, and it appears that you choose Products --> Adaptive Server Enterprise --> Evaluate --> Downloads --> ASE Developer's Edition. Then you'll get to the "Register and Download Now" button. (I didn't go further.)

    ...roboticus

Re: perl+sybase connection
by JavaFan (Canon) on Jul 06, 2010 at 15:27 UTC
    Thought of using DBD::Sybase,is it necessary to install 'sybperl'.
    No. In fact, if you are going the DBD::Sybase way, you don't need sybperl at all. sybperl is useful if you want to use the full power of the Sybase specific interface (DBlib or CTlib). For instance, if you're doing your prototyping in Perl, but your final product will be written in C, you may go for sybperl instead. Or you may already be quite familiar with the Sybase API - another reason to use sybperl.

    OTOH, if your goal is to be able to switch databases, the DBI/DBD::Sybase is a first, small step. You'd still need to be careful when writing SQL code though - it's quite easy to write SQL code that's specific for the current database.