You are currently viewing Zend Server 5.x documentation. Click here to view the latest Zend Server online documentation.
You are here: API Reference Guide > PHP XMLSERVICE Toolkit > Toolkit Service Class > Define Program Parameters > The UpdateParameterValue Method

The UpdateParameterValue Method

UpdateParameterValue ($Name, $Value) - Update a parameter value.

 

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();
?>

 

 

 

Related Links

Related Links:

Define Program Parameters

Toolkit Service Class

 

 

 

© 1999-2013 Zend Technologies, Ltd. All rights reserved.