Skip to Content.
Sympa Menu

freetds - RE: [freetds] Comment on change

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Comment on change
  • Date: 05 Mar 2003 10:53:18 -0800

On Wed, 2003-03-05 at 07:55, Thompson, Bill D (London) wrote:

>
> > ?? skipping data instead to send a proper cancel is quite bad... if server
> > is returning huge amount of data cancel take ages.... IMHO libtds
> (token.c)
> > should be encharge for processing cancel, not dblib.
>
> I'm not skipping data *instead* of sending a proper cancel, but prior to
> sending the cancel.
> Notice I still call tds_send_cancel() after skipping the data.
> The following is an extract from the Sybase manual page for dbcancel:
> --------
> This routine cancels execution of the current command batch on the server
> and flushes any pending results.
> The application can call it after calling dbsqlexec, dbsqlsend, dbsqlok,
> dbresults, or dbnextrow.
> dbcancel sends an attention packet to the server which causes the server to
> cease execution of the command batch.
> Any pending results are read and discarded.
> dbcancel cancels all the commands in the current command batch.
> To cancel only the results from the current command, call dbcanquery
> instead.
> --------
>
> As you can see, this suggests that any pending results (however many there
> are) need to be read and discarded.

Hmmm. I'm not sure.

The following perl script, using Sybase::DBlib (a very thin wrapper
around DBlib) works fine:

$dbh->dbcmd("select * from excalibur..market
select * from excalibur..market_perpetual");
$dbh->dbsqlexec;
$dbh->dbresults;
$dbh->dbnextrow;
$dbh->dbcancel;

$dbh->dbcmd("select getdate()");
$dbh->dbsqlexec;
$dbh->dbresults;
my ($date) = $dbh->dbnextrow;
print "$date\n";

__END__

where market and market_perpetual are rather large tables...

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler AT peppler.org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html




Archive powered by MHonArc 2.6.24.

Top of Page