php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30899 Can't execute a stored procedure
Submitted: 2004-11-25 18:21 UTC Modified: 2004-12-15 02:48 UTC
From: acgouveia at refertelecom dot pt Assigned:
Status: Not a bug Package: ODBC related
PHP Version: Irrelevant OS: Windows Server 2000
Private report: No CVE-ID: None
 [2004-11-25 18:21 UTC] acgouveia at refertelecom dot pt
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..."



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-15 02:48 UTC] sniper@php.net
1. Too old version. (we're at 4.3.9 atm!)
2. similar reports exist already, add comments to those

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC