|
wb_psql_param_count | 'Prepared' SQL Functions | wb_psql_send_param |
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 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 |
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";
wb_psql_param_count | 'Prepared' SQL Functions | wb_psql_send_param |