There are good resources at the Zend i5/OS forums.

www.zend.com/forums

This is an example from Jon Paris from a while ago.

<?
// $conn = i5_connect("localhost", "MYUSERID", "MYPASSWORD");
// if (!$conn) {
// throw_error("i5_connect");
// exit(); }

$description = array(
array("Name"=>"PROD_ID", "IO"=>I5_IN,
"Type"=>I5_TYPE_CHAR, "Length"=>"7" ),
array("Name"=>"STORE_LOC", "IO"=>I5_IN,
"Type"=>I5_TYPE_CHAR, "Length"=>"10" ),
array("Name"=>"PRICE", "IO"=>I5_INOUT,
"Type"=>I5_TYPE_PACKED, "Length"=>"5.2" ),
);
$pgm = i5_program_prepare("LIBRARY/PHPTEST", $description);
if (!$pgm) {
throw_error("i5_program_prepare");
exit();
}
$parameter = array("PROD_ID"=>"xyz101","STORE_LOC"=>"a1001",
"PRICE"=>100.00);
$parmOut = array("PROD_ID"=>"PROD_ID", "STORE_LOC"=>"STORE_LOC",
"PRICE"=>"AMOUNT");
$ret = i5_program_call($pgm, $parameter, $parmOut);
if (!$ret) {

throw_error("i5_program_call");
exit();
}
echo "Product Id: ".$PROD_ID."<br>";
echo "Store Location: ".$STORE_LOC."<br>";
echo "Price: ".$AMOUNT."<br>";
i5_program_close($pgm);
i5_close($conn);
function throw_error($func) {
echo "Error in function: ".$func." --- ";
echo "Error Number: ".i5_errno()." --- ";
echo "Error Message: ".i5_errormsg()."<br>";
}
?>

====================================
// Should really use PR/PI but ...
C *ENTRY PLIST
C PARM prod_id 7
C PARM store_loc 10
C PARM price 5 2
/FREE
price = price + 10.99;
*INLR = *ON;
/END-FREe
================================


Bryan Dietz




On Wed, Oct 1, 2008 at 12:36 PM, Gerald <gmagnuson@xxxxxxxxxxxxx> wrote:
I have created a stored procedure (in RPGLE), that accepts an input parm
(customer number), and returns back a number (active orders).
However, I can't explain to our PHP coders how to structure the call?

we connect to the system i with ODBC.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.