I am surprised by the order of the data returned from my stored
procedure, and that it appears associated with the incorrect variables.
Apparently the data is returned entirely positionally, without
consideration for the variable names. So, the names of the OUT
parameters in the procedure appear to be invisible outside of the
procedure. Although I pass in variables with the same names as the
Parameters, they are filled positionally - in the "wrong" variables -
because in this case I had two variables reversed positionally.
When I retrieve them using fetch_assoc, the wrong data appears in the
result.
This contrasts with a passed in query such as "Select * From Table",
which would have the data in the column names. My fetch_assoc would work
properly with this same code, just changing to a simple query.
In other database I have worked with, the output of a stored procedure
can be referenced by that procedures parameter names. The approach here
has its advantages, but 1) it is not documented that way, and 2) it
creates a dependency in the client code that is sensitive to the ordered
position of the procedure parameters, rather than the name - which as
noted, differs from the handling of simple queries. Oddly, this creates
a situation where queries are preferred over stored procedures for
stability - the opposite of normal design strategy.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php