Re: dbcanquery() with pdo_dblib

"Thompson, William" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <4A990489BF566041A7724DC577BB060417583507@smtp_mail.bankofamerica.com>
Hi Adam,

I don't think you've misunderstood what dbcanquery is supposed to do. The Sybase documentation says that it is equivalent to calling dbnextrow until it reurns NO_MORE_ROWS, which is pretty much what you've replicated.
So it looks like our implementation of dbcanquery() isn't exactly the same as doing that...

It's difficult to see what might be happening without a debug log
Can you run your test of dbcanquery() with TDSDUMP logging set? And then post with the log attached?
See http://www.freetds.org/userguide/logging.htm

Cheers,

Bill


-----Original Message-----
From: FreeTDS [mailto:[email protected]] On Behalf Of Adam Baratz
Sent: 16 June 2016 17:19
To: [email protected]
Subject: [freetds] dbcanquery() with pdo_dblib

Hi,

I'm looking at fixing this bug with the PHP pdo_dblib extension:
https://bugs.php.net/bug.php?id=67130

I have it built to use FreeTDS to communicate with MSSQL.

My understanding from the docs is that dbcanquery() does what's needed here. Basically, it should be called before using dbresults() to get the next rowset[1]. However, that doesn't seem to resolve the issue. The call succeeds, but the call to dbresults() will then fail. What I've found works is fetching the rows manually:

RETCODE ret = SUCCESS;

while (ret == SUCCESS) {
ret = dbnextrow(H->link);
}

I don't want to do anything with these rows, so I'd rather not do this. Am I missing something basic about how dbcanquery() is supposed to be used?

Thanks,
Adam

---
[1]
https://github.com/php/php-src/blob/aed42496534fe54c5c0ce64fe0ca5c9d801d6161/ext/pdo_dblib/dblib_stmt.c#L144
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient, please delete this message.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.