ODBC, Stored Procedures and OUT parameters
| From: | (Lars Thomas Denstad) | Date: | Tue, 02 Nov 1999 22:16:10 +0000 |
| Subject: | ODBC, Stored Procedures and OUT parameters | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5842@lists.php.net to get a copy of this message | ||
I'm currently working on moving a piece of code from C++ to PHP3/4, but I'm
stranded on calling stored procedures using OUT parameters; procedures that
return data through their parameters.
I'm developing on Win NT 4.0, versions I'm running are PHP version 3.0.11
and the PHP 4.0 PreBeta3.
From the examples I would think the code should look like this:
$params = array ("Inparam", "", "");
$i_ret = odbc_prepare($db_handle, "{call in_out_proc ( ?, ?, ? )}");
$j_ret = odbc_execute($i_ret, &$params);
The in_out_proc takes is supposed to take the in parameter from [0] in the
array and store data in positions [1] and [2], and I was hoping to be able
to access the result with params[1] and params[2].
Using PHP3 as a CGI, however, ends up with a memory protection failure.
Running PHP4PreBeta3 just hangs the download, and I most of the time have to
reboot the machine to get IIS up and running correctly again.
I've also played around with passing larger strings with just spaces in the
array and also passing references to other strings, but while it prevents
the application from crashing, it doesn't seem to make the data available
for me.
I would have a look at the source, but I haven't been able to build it using
MSVC++5.0 (do I need 6.0?).
Any pointers would be greatly appreciated. Also, information on how to call
stored functions would with the same setup, would be helpful.
Thanks,
LT.