#35920 [Com]: mssql_bind(): Unable to set parameter
| From: | none at none dot com | Date: | Sat, 14 Jan 2006 14:45:16 +0000 |
| Subject: | #35920 [Com]: mssql_bind(): Unable to set parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91906@lists.php.net to get a copy of this message | ||
ID: 35920
Comment by: none at none dot com
Reported By: eaboyle at gemstonewd dot com
Status: Assigned
Bug Type: MSSQL related
Operating System: window XP pro
PHP Version: 5CVS, 4CVS (2006-01-07) (snap)
Assigned To: fmk
New Comment:
won't $result ccontain the response object from the stored proc ?
i.e. your passing in two params, where your procedure expects one,
hence your unable to set the invalid parameter.
for example, do you just need to use mssql_next_result /
mssql_fetch_row on $result to get the output?
Paul
Previous Comments:
------------------------------------------------------------------------
[2006-01-07 00:22:59] sniper@php.net
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-01-06 23:58:05] eaboyle at gemstonewd dot com
I upgraded to 5.1.latest and still get the same result.
------------------------------------------------------------------------
[2006-01-06 16:48:20] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2006-01-06 16:19:06] eaboyle at gemstonewd dot com
Description:
------------
I'm trying to get output from an mssql stored procedure.
I get "mssql_bind(): Unable to set parameter warning on line 6.
I have "allow_call_time_pass_reference = On" in my php.ini.
Reproduce code:
---------------
1 $db = new clsDBsqlRags();
2 $db->connect();
3 $stmt=mssql_init("sp_NEXT_ACT_NUM ",$db->Link_ID);
4 $act_base = 1;
5 mssql_bind($stmt,"@ACT_BASE", $act_base, SQLINT4);
6 mssql_bind($stmt, "RTNVAL", &$act_num, SQLINT4);
7
8 $result=mssql_execute($stmt, FALSE);
Stored procedure:
CREATE PROCEDURE sp_NEXT_ACT_NUM
@ACT_BASE int
AS
DECLARE
@Act int --FETCHED CLIENT.ACCOUNT VALUE
--GET SET OF ACCOUTS FROM CLIENT TABLE
DECLARE Crsr_Act CURSOR
FOR
SELECT C.ACCOUNT
FROM CLIENT C
WHERE C.ACCOUNT >= @ACT_BASE
ORDER BY ACCOUNT
OPEN Crsr_Act
FETCH Crsr_Act INTO @Act
--TRAVERSE Crsr_Act
WHILE (@@FETCH_STATUS = 0)
BEGIN
IF @ACT_BASE < @Act
BREAK
ELSE IF @ACT_BASE = @Act
SELECT @ACT_BASE = @ACT_BASE + 1
FETCH Crsr_Act INTO @Act
END
CLOSE Crsr_Act
DEALLOCATE Crsr_Act
RETURN @ACT_BASE
GO
Expected result:
----------------
expect $act_num to be set to the return value of the mssql stored
procedure.
Actual result:
--------------
mssql_bind(): Unable to set parameter warning on line 6.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35920&edit=1