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: 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 =
\"$tmptablename\")\n");
    &dbcmd($dbproc, "begin\n");
    &dbcmd($dbproc, "drop table $tmptablename\n");
    &dbcmd($dbproc, "end\n");
    &dbsqlexec($dbproc);
    &dbresults($dbproc);

    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.

Thanks


--
                         
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