Number of Result Columns
| From: | Steve Williams | Date: | Thu, 10 Jun 1999 18:48:06 +0000 |
| Subject: | Number of Result Columns | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6805@lists.php.net to get a copy of this message | ||
I would like to add the following segment of code to the bottom of
UODBC_FUNCTION(execute) in the unified_odbc.c module.
if (result->numcols == 0)
{
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0){
if (!UODBC_BINDCOLS(result)){
efree(result);
RETVAL_FALSE;
}
} else {
result->values = NULL;
}
}
The reason is that Empress cannot always return the number of columns in
a table after prepare. Therefore this gives a second chance to find this
out.
What I am wondering is should I wrap it in a #if HAVE_EMPRESS option, or
whether I should leave it open?
As far as I am aware, Empress is the only database that has this
problem. But it could occur elsewhere because the ODBC does not require
SQLNumResultCols to be available after prepare, only after execute. Of
course it shouldn't affect any RDBMS that has returned a result after
prepare.
Steve
--
Steve Williams Interactive Media & Tools Group
Empress Software Inc. http://www.empress.com