CVS update: php3/functions
| From: | swilliam | Date: | Fri, 11 Jun 1999 11:23:46 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6816@lists.php.net to get a copy of this message | ||
Date: Friday June 11, 1999 @ 7:23
Author: swilliam
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv17734/php3/functions
Modified Files:
unified_odbc.c
Log Message:
Added extra call after SQLExecute command. This is to allow the interface
a second chance to retrieve the number of columns being retrieved from
a table. This was added because the Empress RDBMS cannot always return
the value after SQLPrepare - specifically when parameter binding is
required in the SQL statement. I have not wrapped this in a
HAVE_EMPRESS ifdef block because I prefer to avoid vendor specific items
in generic interfaces wherever possible, also it MIGHT prove useful if
any other RDBMS has this problem... If anyone has a problem with this they
can just wrap an #ifdef around this loop.
Index: php3/functions/unified_odbc.c
diff -u php3/functions/unified_odbc.c:1.106 php3/functions/unified_odbc.c:1.107
--- php3/functions/unified_odbc.c:1.106 Mon May 10 11:37:18 1999
+++ php3/functions/unified_odbc.c Fri Jun 11 07:23:46 1999
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: unified_odbc.c,v 1.106 1999/05/10 15:37:18 kara Exp $ */
+/* $Id: unified_odbc.c,v 1.107 1999/06/11 11:23:46 swilliam Exp $ */
/* This file is based on the Adabas D extension.
* Adabas D will no longer be supported as separate module.
@@ -915,6 +915,20 @@
if (rc == SQL_SUCCESS){
RETVAL_TRUE;
+ }
+
+ 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;
+ }
}
}
/* }}} */