PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Robb Canfield <robbc at canfield dot com>
Subject: Simple SybPerl test fails
Date: Mar 9 1998 8:19AM

After getting SybPerl to compile on RedHat I encountered a "segmentation
fault" running one of the examples from Michael Peppler's web page: 
  http://www.mbay.net/~mpeppler/Sybperl/article.html

It appears to run properly and then crashes. I of course altered the
'user', 'password' and "SERVER' entries from the example code. This is
running on RedHat 5.0.

Has anyone gotten this code to work, or is this example not valid?

Thanks

---- Sample Code Follows ----
#!/usr/local/bin/perl

# Load the Sybase::CTlib module:
use Sybase::CTlib;

# Allocate a new Database 'handle':
$dbh = new Sybase::CTlib 'user', 'password', 'SERVER';

# Send the query to th server:
$dbh->ct_execute("select uid, name from sysusers");

# Retrieve the result sets 
while($dbh->ct_results($restype) == CS_SUCCEED) {

    # Skip non-fetchable results:
    next unless $dbh->ct_fetchable($restype);

    # Retrieve actual data rows:
    while(($uid, $name) = $dbh->ct_fetch) {
        print "$uid - $name\n";
    }
}


----- Output Follows -----
16389 - replication_role
16388 - navigator_role
16387 - sybase_ts_role
16386 - oper_role
16385 - sso_role
16384 - sa_role
0 - public
2 - guest
1 - dbo
Segmentation fault