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: Mark Haviland <mhaviland at WamNet dot com>
Subject: Sybase::Dblib problem...
Date: May 18 1998 10:43PM

Hi,

I'm trying to implement some of my own methods that extend the
Sybase::DBlib, but for some reason cannot get status results when I do a
dbsqlexec.  My subclass starts out like this:

package CisSybDb;
use strict;
use Exporter;
use Sybase::DBlib;
use Carp qw (croak);
use vars qw (@ISA);

@CisSybDb::ISA = qw (Sybase::DBlib);
@CisSybDb::EXPORT = qw(new, DbQuery, DbGetResults);
@CisSybDb::EXPORT_OK = qw(new, DbQuery, DbGetResults);


then later on I have the following code that does my query:

sub DbQuery {

  my ($dbh, $sql_cmd) = @_;
  my ($status);
  if (!$dbh) { croak "\n Could not get database handle. \n"; }

  $dbh->dbcmd($sql_cmd);
  $status = $dbh->dbsqlexec;
  croak "\n Could not execute database command.\n" unless ($status ==
$Sybase::DBlib::SUCCEED);
  $dbh->dbresults;

  return $dbh;
} #end method DbQuery


For some reason, I can never cause the above 'croak'  to occur (when I
try to exec a query with invalid parameters...ie. the query gives me a
return status of 0).

Any ideas on what I'm doing wrong ???

thanks,

-Mark


--
Mark Haviland          WAM!NET Inc.
Software Engineer      6100 West 110th St.
Phone: 612-886-5661    Bloomington, MN  55438-2264
mhaviland@wamnet.com   http://www.wamnet.com