602SQL Documentation Index  

wb_psql_out_param_length

PHP

int wb_psql_out_param_length( resource psql, int out_param_index )


Parameters

psql
Identifier of a prepared SQL statement, the result of the wb_psql_prepare function. Required parameter.
out_param_index
Index of the OUT parameter. Index of the first OUT parameter is 0, index of the last OUT parameter is one less than the result of the wb_psql_out_param_count function. WARNING: This index is different from the index that is used when calling the wb_psql_param_count, wb_psql_param_info and wb_psql_send_param functions, for which all parameters of the SQL statement are indexed! The index used in this function only enumerates the OUT and INOUT parameters. Required parameter.


Description

This function returns the length of an OUT or INOUT parameter whose index is specified in the out_param_index parameter. The SQL statement with the psql identifier must have already be successfully executed by the wb_psql_execute function.



Returns

Returns the length of the OUT or INOUT parameter of the SQL statement if succesful, otherwise FALSE.



Example

Send an IN parameter value to the SQL Server, execute the statement, get the OUT parameters count, get the length of the OUT parameter and read the OUT parameter value.

$psql=wb_psql_prepare($connection,"SELECT name INTO ? FROM Person WHERE ID=?");
wb_psql_send_param($psql, 1 /*second parameter*/, 123 /*parameter value*/);
wb_psql_execute($psql);
echo "OUT parameter count: ".wb_psql_out_param_count($psql)."\n";
echo "length of the first OUT parameter: ".wb_psql_out_param_length($psql,0)."\n";
echo "value of the first OUT parameter: ".wb_psql_get_out_param($psql,0)."\n";    

Viz