|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-11-12 21:11 UTC] pajoye@php.net
-Package: MSSQL related
+Package: sqlsrv
[2012-11-12 21:11 UTC] pajoye@php.net
[2012-11-12 21:33 UTC] jkint@php.net
[2020-02-07 14:51 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2020-02-07 14:51 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
Description: ------------ In sqlsrv_query function, fourth parameter is array that can contain following three options with corresponding keys : QueryTimeout, SendStreamParamsAtExec , Scrollable You would assume that you can specify options in any order, however, this is not true. If you run following script, you will hit unspecified error "[Microsoft][ODBC Driver Manager] Invalid cursor state" However, if you change order to: $config = array( 'Scrollable' => SQLSRV_CURSOR_KEYSET, 'QueryTimeout' => 2, ); then everything works OK. As this is illogical, I think this is bug and should be fixed. Test script: --------------- $link = sqlsrv_connect ( 'serverName\sqlexpress', $connectionInfo ); $config = array( 'QueryTimeout' => 2, 'Scrollable' => SQLSRV_CURSOR_KEYSET, ); $query = "CREATE TABLE #MY_TABLE([var1] [bigint] NOT NULL);"; $result = sqlsrv_query($link,$query,array(),$config) or die("ERROR ". print_r(sqlsrv_errors(),true)); Expected result: ---------------- OK Actual result: -------------- ERROR Array ( [0] => Array ( [0] => 24000 [SQLSTATE] => 24000 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Invalid cursor state [message] => [Microsoft][ODBC Driver Manager] Invalid cursor state ) )