PreviousNext
Help > API Functions > Native database access > i5_getparam
i5_getparam

 

 Retrieves parameter value from a request or a stored procedure.

 

      Mixed i5_ getparam (resource stmt, int position)

 

 

Parameters

 

query

request ID returned by i5_prepare.

position

Parameter index (marker)

 

Return

Returns parameter value or FALSE in case it fails.

 

I5_ERR_PHP_HDLDFT

256

No default connection found.

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_TYPEPARAM

262

Type of element x in parameter -1 must be y. Type z was provided.

 

Example

 

 

$stmt = i5_prepare("CALL EASYCOM/S_ORD_SUM(?,?,?)");

if (is_bool($stmt))

 trigger_error("i5_prepare error : ".i5_errormsg(), E_USER_ERROR); 

 

$res = i5_execute($stmt, array(1351));

if (!$res)

 trigger_error("i5_execute error : ".i5_errormsg(), E_USER_ERROR); 

 

// Taking into account that OP1 and STR2 are IN/OUT

$P0 = i5_getparam($stmt, 0);

if (is_bool($P0) && $P0 == FALSE)

    print_r("i5_getparam error : ".i5_errormsg().'<br/>');

else

    echo 'P0 = ' . $P0 .'<br/>';

                                                   {

$P1 = i5_getparam($stmt, 1);

if (is_bool($P1) && $P1 == FALSE)

    print_r("i5_getparam error : ".i5_errormsg().'<br/>');

else

    echo 'P1 = ' . $P1 .'<br/>';

 

$P2 = i5_getparam($stmt, 2);

if (is_bool($P2) && $P2 == FALSE)

    print_r("i5_getparam error : ".i5_errormsg().'<br/>');

else

    echo 'P2 = ' . $P2 .'<br/>';



 

See also

 

i5_prepare

i5_execute

i5_setparam