|
|
sybperl-l Archive
Up Prev Next
From: gbu at uhc dot com (Gary Udstrand)
Subject: Re: results pending error
Date: May 6 1998 9:16PM
With the assistance it is now working. Thanks to everyone for
their help.
On Wed, 6 May 1998 13:09:51 -0700 (PDT), you wrote:
>Gary Udstrand writes:
> >
> >
> >
> >
> > 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);
>
>You must call dbresults() until it returns $NO_MORE_RESULTS, because
>the SQL that you execute is multi-statement.
>
>So do something like (perl4/sybperl1.x syntax):
>
> while(&dbresults($dbproc) != $NO_MORE_RESULTS) {
> while(@return_data = &dbnextrow($dbproc)) {
> print "@return_data\n";
> }
> }
>
>Michael
--
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
|