wb_field_type

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 type | returned string |
BOOLEAN | BOOLEAN |
CHAR | CHAR |
TINYINT | TINYINT |
SMALLINT | SMALLINT |
INTEGER | INT |
BIGINT | BIGINT |
NUMERIC | NUMERIC |
REAL | REAL |
CHAR(n) | VARCHAR |
NCHAR(n) | NCHAR |
BINARY(n) | BINARY |
DATE | DATE |
TIME | TIME |
TIMESTAMP | TIMESTAMP |
CLOB | CLOB |
NCLOB | NCLOB |
BLOB | BLOB |
other types | FALSE |
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; }