Thanks for your answer Mike.
On Dec 11, 2015 7:19 AM, "Mike Pavlak" <mike.p@xxxxxxxx> wrote:

Alejandro,

If you review the ODBC extension at PHP.net you will see there is no
support for out or in/out parameters.
http://php.net/manual/en/function.odbc-prepare.php

"If you need to call a stored procedure using INOUT or OUT parameters, the
recommended workaround is to use a native extension for your database (for
example, mssql <http://php.net/manual/en/ref.mssql.php> for MS SQL Server,
or oci8 <http://php.net/manual/en/ref.mssql.php> for Oracle)."

As the quote implies, the native DB2 extension would support this as
indicated here: http://php.net/manual/en/function.db2-bind-param.php .
However, this would require either native processing on IBM i or purchasing
the DB2_Connect software from IBM that would bring the full DRDA protocol
down to Ubuntu.


Regards,

Mike



On Thu, Dec 10, 2015 at 4:35 PM, Alejandro Olvera <alolvera@xxxxxxxxx>
wrote:

Does any one here know a work around or the PHP function to retrieve an
output
variable from a IBMi stored procedure.
I'm using Ubuntu UnixODBC and PHP5.

Here's an example of my php code.

$qry = "call storedproc(?,?,?,?,?,?);

If($stmt = odbc_prepare($conn, $qry));
$success = odbc_execute($stmt, array($i1, $i2, $i3, $i4, $i5, $o6));
//after this executed the $o6 string variable is empty.
if($success){
//I tried odbc_result and odbc_result_all and I'm still not getting
any
results

}

FYI my sixth parameter in IBMi stored procedure is set to INOUT and I can
see the value returned back when I debug the job.


Any ideas would be appreciated.

Thanks in advance
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.