602SQL Documentation Index  

wb_field_type_num

PHP

integer wb_field_type_num( resource cursor, integer column_number )
integer wb_field_type_num( resource cursor, string column_name )


Parametry

cursor
Identifier of a cursor returned by the wb_exec or wb_psql_execute function.
column_number
Number of the column whose SQL type number is to be retrieved. The enumeration begins with 1.
column_name
Name of the column whose SQL type number is to be retrieved.


Popis

This function returns the SQL type number of the column specified by name and cursor position number. This function returns one of the ATT_XXX constant types that correspond with the retrieved SQL type.

You may also get the name of the column SQL type with the wb_field_type function.

The PHP module defines the ATT_XXX constants (ATT_BOOLEAN, ATT_CHAR, ATT_INT16, ATT_INT32, ATT_FLOAT, ATT_STRING, ATT_BINARY, ATT_DATE, ATT_TIME, ATT_TIMESTAMP, ATT_TEXT, ATT_NOSPEC, ATT_INT8, ATT_INT64) that can be compared with the return value of this function.

The 602SQL Server type list can be found on the 602SQL Server data types page.



Návratová hodnota

Number of the column SQL type or FALSE if an error occurs.



Příklad

Get the SQL type number of the third column in the $cursor cursor:

  $result = wb_field_type_num($cursor,3);
  if( $result==FALSE ) { ... }
  else { echo "type number: ",$result; }