Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: gbu at uhc dot com (Gary Udstrand)
Subject: results pending error
Date: May 6 1998 5:28PM


	I have a subroutine (actually a series on them) in which I pass a
$dbproc value to handle various sybperl database functions.  All work
without a hitch except for the following, 

sub drop_table {
    local($dbproc, $tmptablename) = @_;

    &dbcmd($dbproc, "if exists (select * from sysobjects where name =
    &dbcmd($dbproc, "begin\n");
    &dbcmd($dbproc, "drop table $tmptablename\n");
    &dbcmd($dbproc, "end\n");

    while (@return_data = &dbnextrow($dbproc)) {
        print "@return_data\n";

	Everytime I execute this sub I get the following error message on
subsequent attempts to use the $dbproc value.  

Sybase error: Attempt to initiate a new SQL Server operation with
results pending.

I added the while loop at the end to check for any results but their
are none.  If I remove the call to &drop_table all the other calls
work with out a hitch.  What am I missing here??

	I am running Sybase 11 using sybperl/perl 4.0.


Gary Udstrand 
The opinions expressed are mine only, unless you agree with me.

The world is filled with willing people; some willing to work, the rest 
willing to let them. 
							-Robert Frost