602SQL Documentation Index  

wb_field_type

PHP

string wb_field_type( resource cursor, integer column_number )
string wb_field_type( 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 name is to be retrieved. The enumeration begins with 1.
column_name
Name of the column whose SQL type name is to be retrieved.


Popis

This function returns the SQL type of a column specified by the cursor column number. This function returns these SQL type names:

column typereturned string
BOOLEANBOOLEAN
CHARCHAR
TINYINTTINYINT
SMALLINTSMALLINT
INTEGERINT
BIGINTBIGINT
NUMERICNUMERIC
REALREAL
CHAR(n)VARCHAR
NCHAR(n)NCHAR
BINARY(n)BINARY
DATEDATE
TIMETIME
TIMESTAMPTIMESTAMP
CLOBCLOB
NCLOBNCLOB
BLOBBLOB
other typesFALSE

You may also get the SQL type number with the wb_field_type_num function.



Návratová hodnota

String with the name of the column SQL type or FALSE if an error occurs.



Příklad

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

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