etangeman Posted January 10, 2013 Share Posted January 10, 2013 Greetings, I have been stump for a while now trying to call a stored procedure on the IBM i that call a CL program. If anyone has experience i could sure use some help. I will post the code below. Code is below... Thanks for your help Edsel <script> function display_alert() { <?php function ShowErrMsg2($msgText) { echo '<tr><td colspan="6">', $msgText, '</td></tr>'; } // Script to Email report and Display message $host = 'xxxxxxx'; $user = 'xxxxxxx'; $password = 'xxxxxxx'; $dbconn = db2_connect($host,$user,$password); If (! $dbconn) ShowErrMsg2 ( "Failed open: $errorText" ); $sql=db2_prepare($dbconn, 'CALL xxxxxxx/EVNIHDBOL()'); db2_exec($sql); db2_close($dbconn); ?> alert("Spreadsheet Emailed!"); } </script> Link to comment https://forums.phpfreaks.com/topic/272977-call-a-stored-procedure-on-the-ibm-i/ Share on other sites More sharing options...
Christian F. Posted January 11, 2013 Share Posted January 11, 2013 What's the error message? If you don't have one, you'll need to add some basic error checking and reporting to your code. Check the PHP manual for the functions you're using, to find their return values for failure. There should also be a function for reporting back the error from the DB2 engine, which you'll need if any of the DB2 functions return an error condition. PS: Please use the [code][/code] tags around your code, as it helps make both your post and your code a lot easier to read. Link to comment https://forums.phpfreaks.com/topic/272977-call-a-stored-procedure-on-the-ibm-i/#findComment-1404897 Share on other sites More sharing options...
etangeman Posted January 11, 2013 Author Share Posted January 11, 2013 Thanks Christian f. I will try to add some error checking and post. It may take a while as i am new to the PHP world and learning this on the side. Link to comment https://forums.phpfreaks.com/topic/272977-call-a-stored-procedure-on-the-ibm-i/#findComment-1405031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.