Jump to content

Call a Stored Procedure on the IBM i


etangeman

Recommended Posts

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 by etangeman
Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.