etangeman Posted January 10, 2013 Share Posted January 10, 2013 (edited) 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> Edited January 10, 2013 by etangeman Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.