oci_field_type_raw

(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)

oci_field_type_raw — 필드의 원시 Oracle 데이터 유형을 알려줍니다.


설명

oci_field_type_raw(resource $statement, string|int $column): int|false

column의 Oracle 원시 "SQLT" 데이터 유형을 반환합니다.

필드의 유형 이름을 원하면 대신 oci_field_type()을 사용하십시오.


매개변수

statement
유효한 OCI 문 식별자입니다.
column
필드의 인덱스(1부터 시작) 또는 이름일 수 있습니다.

반환 값

Oracle의 원시 데이터 유형을 숫자로 반환하거나 실패 시 false를 반환합니다.


Examples

예제 #1 oci_field_type_raw() 예제

                  
<?php

// Create the table with:
//   CREATE TABLE mytab (number_col NUMBER, varchar2_col varchar2(1), clob_col CLOB, date_col DATE);

$conn = oci_connect("hr", "hrpwd", "localhost/XE");
if (!$conn) {
    $m = oci_error();
    trigger_error(htmlentities($m['message']), E_USER_ERROR);
}

$stid = oci_parse($conn, 'select * from mytab');
oci_execute($stid, OCI_DESCRIBE_ONLY);  // Use OCI_DESCRIBE_ONLY if not fetching rows
$n = oci_num_fields($stid);
for ($i = 1; $i <= $n; ++$i) {
    echo oci_field_name($stid, $i) . " is raw type: " . oci_field_type_raw($stid, $i) . "<br>\n";
}

// Output is:
//    NUMBER_COL is raw type: 2
//    VARCHAR2_COL is raw type: 1
//    CLOB_COL is raw type: 112
//    DATE_COL is raw type: 12

oci_free_statement($stid);
oci_close($conn);

?>
                    
                  

노트

메모: PHP 5.0.0 이전 버전에서는 대신 ocicolumntyperaw()을 사용해야 합니다. 이 이름은 여전히 ​​사용할 수 있으며 하위 호환성을 위해 oci_field_type_raw()의 별칭으로 남겨졌습니다. 그러나 이것은 더 이상 사용되지 않으며 권장되지 않습니다.