API Reference Guide > PHP XMLSERVICE Toolkit > Toolkit Service Class > Define Program Parameters > The UpdateParameterValue Method

The UpdateParameterValue Method

 

Arguments

Value

Description

$Name

 

Parameter name

$Value

 

Parameter value

Sample Code

Usage Example

<?php

 

include_once 'authorization.php';

include_once '../API/ToolkitService.php';

include_once 'helpshow.php';

$extension='ibm_db2';

try {

$ToolkitServiceObj = ToolkitService::getInstance($db, $user, $pass, $extension);

}

catch (Exception $e)

{

echo $e->getMessage(), "\n";

exit();

}

 

$ToolkitServiceObj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user"));

$code = ‘1’;

$desc = ' ';

 

$param[] = $ToolkitServiceObj-

>AddParameterChar('both', 10,'InventoryCode', 'code', $code);

$param[] = $ToolkitServiceObj-

>AddParameterChar('both', 10,'Description', 'desc', $desc);

$result = $ToolkitServiceObj-

>PgmCall("COMMONPGM", "ZENDSVR", $param, null, null);

if($result){

showTable( $result['io_param']);

}

else

echo "Execution failed.";

/* Set a different parameter value in the “code” parameter and call the program again*/

ProgramParameter::UpdateParameterValues( $param, array('code'=>'2'));

$result = $ToolkitServiceObj-

>PgmCall("COMMONPGM", "ZENDSVR", $param, null, null);

if($result){

showTable( $result['io_param']);

}

else

echo "Execution failed.";

 

/* Do not use the disconnect() function for "state full" connection */

$ToolkitServiceObj->disconnect();

?>

 

 

Read Also

  PHP XMLSERVICE Toolkit    
  Toolkit Service Class    
  Define Program Parameters