wb_psql_param_info

array wb_psql_param_info( resource psql, int param_index )
Parameters
-
psql
- Identifier of a prepared SQL statement, the result of the wb_psql_prepare function. Required parameter.
-
param_index
- Index of the parameter we want to get information about. Index of the first parameter is 0, index of the last parameter is one less than the result of the wb_psql_param_count function. Required parameter.
Description
This function gets information about the parameter whose index is passed in the param_index parameter.
Information about the parameter may be retrieved only if the prepared SQL statement has not been closed yet (see wb_close).
Returns
Returns FALSE if an error occurs. Otherwise, information about the parameter of the prepared SQL statement is returned. The information is returned as an array of strings.
array item index | value type | information |
type | int | database type of the prepared SQL statement parameter; one of the constants ATT_xxx described here (value type numbers - see the Data_type column of the _IV_TABLE_COLUMNS system query) |
specif | int | supplemental information about the parameter database type; numeric value of the variant structure t_specif |
mode | int | direction of the parameter; one of the constants MODE_IN, MODE_OUT, MODE_INOUT |
position | int | parameter position (the ? character) in the source text of the prepared SQL statement; character positions are numbered from 0, the first character of the source text has position 0 |
Example
Get the information about SQL statement parameters.
$psql=wb_psql_prepare($connection,"SELECT name INTO ? FROM Person WHERE ID=?");
echo "SQL statement has ".wb_psql_param_count($psql)." parameters.\n";
$array=wb_psql_param_info($psql,0);
echo " first parameter: type ".$array["type"].", specif ".$array["specif"].", mode ".$array["mode"].", position ".$array["position"]."\n";
$array=wb_psql_param_info($psql,1);
echo " second parameter: type ".$array["type"].", specif ".$array["specif"].", mode ".$array["mode"].", position ".$array["position"]."\n";
Viz