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: Jeremy Hansen <jeremy at ptd dot net>
Subject: Simple Question
Date: Sep 9 1997 2:34PM

Basically I'm getting an error:

DB-Library error:
        Attempt to initiate a new SQL Server operation with results
pending.
DB-Library error:
        Attempt to initiate a new SQL Server operation with results
pending.
DB-Library error:
        Attempt to initiate a new SQL Server operation with results
pending.

I'm a beginner so I'm still trying to work things out, but what I'm trying
to do should be very simple.  Here's the perl program doing the
processing:

#!/usr/local/bin/perl
#
# Query/Update Cable DB by anything.
#

#perl includes
use Sybase::DBlib;

# do query
$dbh = new Sybase::DBlib 'foo', 'bar', 'DBSRV' || die "Hmmm...$!";
$dbh->dbuse('Accounting');
  $dbh->dbcmd("select * from Cable_cust");

$dbh->dbsqlexec;
$dbh->dbresults;

# retrieve and place values
while(($ID, $ENTRY_DATE, $TESTER, $CABLE_COMPANY, $FIRST_NAME, $MIDDLE_INITIAL, $LAST_NAME, $CONTACT_NAME, $COMPANY_NAME, $STREET_ADDRESS, $STATE, $ZIP, $PHONE, $CABLE_STATUS, $CABLE_IP_ADDRESS, $BOX_IP_ADDRESS, $SERIAL_NUMBER, $MAC_NUMBER, $PROSPECT, $IN

STALLED, $INSTALL_DATE, $AVAIL_NO_ORDER, $NOT_AVAIL, $EST_DATE_AVAIL, $EMAIL, $DIAL_UP_CUSTOMER, $ACCOUNT_NUMBER) = $dbh->dbnextrow) {

($FIRST, $SECOND, $THIRD, $FOURTH, $FIVE) = split(/\s* /, $CONTACT_NAME);

# print "$CONTACT_NAME\n";
print "$FIRST $SECOND $THIRD $FOURTH $FIVE";

$dbh->dbcmd("update Cable_cust set FIRST_NAME='$FIRST', LAST_NAME='$SECOND $THIRD $FORTH $FIVE' where CONTACT_NAME = '$CONTACT_NAME'");
  $dbh->dbsqlexec;
  $dbh->dbresults;

print "...Done.\n";

}


Thank for any help!

-jeremy