|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-04-25 15:04 UTC] acb0038 at auburn dot edu
[2012-04-26 20:19 UTC] acb0038 at auburn dot edu
[2016-10-15 23:12 UTC] kalle@php.net
-Status: Open
+Status: Wont fix
[2016-10-15 23:12 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 00:00:01 2025 UTC |
Description: ------------ I have a Stored Procedure that returns 4 result sets. The proc selects data and inserts into a temp table and then reads back, etc. The temp table is set up to allow null values, but I get this: PHP Warning: mssql_query() [function.mssql-query]: message: Cannot insert the value NULL into column 'PhysAddressLine2', table 'tempdb.dbo.#TempRandom_____________________000000000003'; column does not allow nulls. INSERT fails. (severity 16) in ... I have tested the proc in MSSQL Query Analyser and also tested the script in ASP.NET, both worked fine. Reproduce code: --------------- $sql = "exec sp_dosearch 0,2,7,2,5"; if($qsql = mssql_query($sql, $link)) { echo "<h3>OK</h3>"; /*do { while($row = mssql_fetch_row($qsql)) { } } while (mssql_next_result($qsql)); */ } else { echo"<h3>OWNED</h3>"; } /* also tried */ $query = mssql_init("sp_dosearch", $link); $SortOrder = 0; $PASelectType = 2; $PASelectID = 7; $GeoSelectType = 2; $GeoSelectID = 5; mssql_bind($query, "@SortOrder", $SortOrder, SQLINT2); mssql_bind($query, "@PASelectType", $PASelectType, SQLINT2); mssql_bind($query, "@PASelectID", $PASelectID, SQLINT2); mssql_bind($query, "@GeoSelectType", $GeoSelectType, SQLINT2); mssql_bind($query, "@GeoSelectID", $GeoSelectID, SQLINT2); if($res = mssql_execute($query)) { echo "OK"; } else { echo "OWNED"; } Expected result: ---------------- OK Actual result: -------------- OWNED