Bug #72503 [Com]: [ODBC Cursor Library] Result set was not generated by a SELECT statement, SQL s

From: Date: Mon, 27 Jun 2016 12:11:31 +0000
Subject: Bug #72503 [Com]: [ODBC Cursor Library] Result set was not generated by a SELECT statement, SQL s
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201866@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72503&edit=1 ID: 72503 Comment by: jgeert1 at its dot jnj dot com Reported by: jgeert1 at its dot jnj dot com Summary: [ODBC Cursor Library] Result set was not generated by a SELECT statement, SQL s Status: Open Type: Bug Package: ODBC related Operating System: Windows Server 2008 R2 PHP Version: 5.6.23 Block user comment: N Private report: N New Comment: ODBC Traces can be found here: https://gist.github.com/anonymous/f91784cedbe6a6eb58e88b814deef5c6 Previous Comments: ------------------------------------------------------------------------ [2016-06-27 11:59:54] jgeert1 at its dot jnj dot com Description: ------------ I'm currently running PHP 5.5.12 and use the odbc functions to retrieving data from MS SQL Server databases. I've a query which runs fine (produces the expected result)when using this PHP version. However I would like to upgrade PHP from 5.5.12 to 5.6.23. Installation went smoothly and all existing code seems to run fine on it except one db query, which now produces the error "[ODBC Cursor Library] Result set was not generated by a SELECT statement, SQL state SL004 in SQLGetData ...". I've no idea what's causing it. It runs fine when using the old version of PHP, but with the latest one, it always fails. I also tried PHP 7.0.8, but it also produces the same error. Test script: --------------- $odbcmgt_dsn = "Driver={SQL Server};Server=MYSERVER;Database=MYDATABASE;"; $dbhandle = odbc_connect($odbcmgt_dsn,$odbcmgt_user,$odbcmgt_pwd,SQL_CUR_USE_ODBC); $result = odbc_exec($dbhandle, $sql); while( $row = odbc_fetch_array($result)) { // data procession code } odbc_free_result($result); odbc_close($dbhandle); Expected result: ---------------- +/- 6000 rows of data Actual result: -------------- Error message: Warning: odbc_fetch_array(): SQL error: [Microsoft][ODBC Cursor Library] Result set was not generated by a SELECT statement, SQL state SL004 in SQLGetData in .... ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72503&edit=1

« previous php.bugs (#201866) next »