From: acgouveia at refertelecom dot pt Operating system: Windows Server 2000 PHP version: Irrelevant PHP Bug Type: *General Issues Bug description: Can't execute a stored procedure
Description: ------------ I use PHP statement odbc_do($conn, "EXECUTE RTSVR3.master.dbo.xp_cmdshell 'dtsrunui /S RTSVR3 /U sa /P mdbadm /N DTS_Carrega_Fich_TAC /A var=123'") to call stored procedure on MSSQL 2000 server, which execute a data transformation service. When I use this SQL command directly on SQL Query Analyser, it works. However, via PHP doesn't work, gives the following error: "Warning: odbc_do(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]A server cursor is not allowed on a remote stored procedure or stored procedure with more than one SELECT statement. Use a default result set or client cursor., SQL state 37000 in SQLExecDirect in..." I found this problem on PHP version 4.3.4. Can you tell me, what is wrong? Is it PHP bug or mistake in PHP/Apache configuration? Thanks. Reproduce code: --------------- $sql="EXECUTE RTSVR3.master.dbo.xp_cmdshell 'dtsrunui /S RTSVR3 /U sa /P mdbadm /N DTS_Carrega_Fich_TAC /A sessao=".session_id()."'"; odbc_do($conn, $sql); Expected result: ---------------- Call stored procedure on MSSQL 2000 server, which execute a data transformation service. Actual result: -------------- "Warning: odbc_do(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]A server cursor is not allowed on a remote stored procedure or stored procedure with more than one SELECT statement. Use a default result set or client cursor., SQL state 37000 in SQLExecDirect in..." -- Edit bug report at http://bugs.php.net/?id=30899&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30899&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30899&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30899&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30899&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30899&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30899&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30899&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30899&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30899&r=support Expected behavior: http://bugs.php.net/fix.php?id=30899&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30899&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30899&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30899&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30899&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30899&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30899&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30899&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30899&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30899&r=mysqlcfg