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

Hello Fellow Perlmongers! I have to write a Perl script to connect (Read-only) that will retrieve data from a Sybase db. I am using CPAN Perl 5.8.4 on Solaris UNIX and it appears thast I can use the Perl DBI library to connect to the Sybase db but I was wondering if there is any advantage to using the Sybperl library? Is it easier or has added functionality over Perl DBI library calls? Thanks, Styx

Replies are listed 'Best First'.
Re: Sybperl vs Perl 5.8.4 DBI
by mpeppler (Vicar) on Apr 15, 2005 at 18:58 UTC
    If you are already familiar with DBI then you should use it for this.

    If you are already familiar with Sybase's OpenClient API (in C), then sybperl (or, more precisely, the Sybase::CTlib module) may be a reasonable choice.

    You can also look at Sybase::Simple which provides a few very simple calls on top of Sybase::CTlib.

    You may also be interested in this node.

    Michael

      Thanks Michael!!!!!!! :)
Re: Sybperl vs Perl 5.8.4 DBI
by Anonymous Monk on Apr 18, 2005 at 09:51 UTC
    I've used both, and both have their advantages. And both advantages have to do with portability (!). Using DBI is great if you want to write an application that can be relatively easily be ported to a different database (of course, if your SQL contains a lot of Sybase specific code, this advantage diminishes). It's also simple, and it's easier to find help from within the general Perl community.

    Using Sybperl has the advantage that your API is quite close to the Sybase C libraries. If you are working in an environment where they use other languages to connect to Sybase, it does have its advantages to use a common API. I've worked in an environment where our products were written in C, using Sybase DB library (yeah, this was a while ago). I used Sybperl to help developers write their code by prototyping, debugging and optimizing.

    I can't claim Sybperl is easier than the DBI - or that it's harder. If all you are doing is connecting to the database and repeat the cycle: prepare/execute/fetch/fetch/fetch, they're both simple. But the Sybase API is much richer than the API of the DBI (which is obvious, the API of the DBI needs to work for all databases). So you can probably write slightly more efficient code using Sybperl (but you probably needs very good knowledge of both Sybase and your data to be able to do so).

    Another reason I liked Sybperl was the fact that I used to have the complete Sybase manuals available in dead tree format (but their manuals are available on-line as well: sybooks.sybase.com. One of the few software products which has a (free) manual more extensive and better than Perl)