首页 >函数列表 >oci_field_type

oci_field_type

oci_field_type

(PHP 5, PECL OCI8 >= 1.1.0)

oci_field_type返回字段的数据类型

说明

mixed oci_field_type ( resource $stmt , int $field )

oci_field_type() 返回字段的数据类型。field 参数是字段的索引(从 1 开始)。

Example #1 oci_field_type() 例子

<?php
    $conn 
oci_connect("scott""tiger");
    
$stmt oci_parse($conn"SELECT * FROM emp");
    
oci_execute($stmt);

    echo 
"<table border="1">";
    echo 
"<tr>";
    echo 
"<th>Name</th>";
    echo 
"<th>Type</th>";
    echo 
"<th>Length</th>";
    echo 
"</tr>";

    
$ncols oci_num_fields($stmt);

    for (
$i 1$i <= $ncols$i++) {
        
$column_name  oci_field_name($stmt$i);
        
$column_type  oci_field_type($stmt$i);
        
$column_size  oci_field_size($stmt$i);

        echo 
"<tr>";
        echo 
"<td>$column_name</td>";
        echo 
"<td>$column_type</td>";
        echo 
"<td>$column_size</td>";
        echo 
"</tr>";
    }

    echo 
"</table> ";

    
oci_free_statement($stmt);
    
oci_close($conn);
?>

Note:

在 PHP 5.0.0 之前的版本必须使用 ocicolumntype() 替代本函数。该函数名仍然可用,为向下兼容作为 oci_field_type() 的别名。不过其已被废弃,不推荐使用。

参见 oci_num_fields()oci_field_name()oci_field_size()


  • oci_bind_array_by_name
  • oci_bind_by_name
  • oci_cancel
  • oci_client_version
  • oci_close
  • oci_commit
  • oci_connect
  • oci_define_by_name
  • oci_error
  • oci_execute
  • oci_fetch
  • oci_fetch_all
  • oci_fetch_array
  • oci_fetch_assoc
  • oci_fetch_object
  • oci_fetch_row
  • oci_field_is_null
  • oci_field_name
  • oci_field_precision
  • oci_field_scale
  • oci_field_size
  • oci_field_type
  • oci_field_type_raw
  • oci_free_statement
  • oci_internal_debug
  • oci_lob_copy
  • oci_lob_is_equal
  • oci_new_collection
  • oci_new_connect
  • oci_new_cursor
  • oci_new_descriptor
  • oci_num_fields
  • oci_num_rows
  • oci_parse
  • oci_password_change
  • oci_pconnect
  • oci_result
  • oci_rollback
  • oci_server_version
  • oci_set_action
  • oci_set_client_identifier
  • oci_set_client_info
  • oci_set_edition
  • oci_set_module_name
  • oci_set_prefetch
  • oci_statement_type
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道