1--TEST-- 2oci_field_*() family: basic column types 3--EXTENSIONS-- 4oci8 5--FILE-- 6<?php 7 8require(__DIR__."/connect.inc"); 9 10// Initialization 11$stmtarray = array( 12 "drop table field_funcs3_tab", 13 "create table field_funcs3_tab(c1_c char(2), c2_v varchar2(2), c3_n number, c4_d date)", 14 "insert into field_funcs3_tab values ('c1', 'c2', 3, '01-Jan-2010')" 15); 16 17$v = oci_server_version($c); 18if (strpos($v, 'Oracle TimesTen') === false) { 19 oci8_test_sql_execute($c, array("alter session set nls_date_format = 'DD-MON-YYYY'")); 20} 21oci8_test_sql_execute($c, $stmtarray); 22 23// Run Test 24 25$select_sql = "select * from field_funcs3_tab"; 26 27if (!($s = oci_parse($c, $select_sql))) { 28 die("oci_parse(select) failed!\n"); 29} 30 31if (!oci_execute($s)) { 32 die("oci_execute(select) failed!\n"); 33} 34 35$row = oci_fetch_array($s, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS); 36var_dump($row); 37 38foreach ($row as $num => $field) { 39 $num++; 40 var_dump(oci_field_is_null($s, $num)); 41 var_dump(oci_field_name($s, $num)); 42 var_dump(oci_field_type($s, $num)); 43 var_dump(oci_field_type_raw($s, $num)); 44 var_dump(oci_field_scale($s, $num)); 45 var_dump(oci_field_precision($s, $num)); 46 var_dump(oci_field_size($s, $num)); 47} 48 49// Clean up 50 51$stmtarray = array( 52 "drop table field_funcs3_tab" 53); 54 55oci8_test_sql_execute($c, $stmtarray); 56 57?> 58--EXPECTF-- 59array(4) { 60 [0]=> 61 string(2) "c1" 62 [1]=> 63 string(2) "c2" 64 [2]=> 65 string(1) "3" 66 [3]=> 67 string(1%r[19]%r) "%r(01-JAN-2010|0001-01-20 10:00:00)%r" 68} 69bool(false) 70string(4) "C1_C" 71string(4) "CHAR" 72int(96) 73int(0) 74int(0) 75int(2) 76bool(false) 77string(4) "C2_V" 78string(8) "VARCHAR2" 79int(1) 80int(0) 81int(0) 82int(2) 83bool(false) 84string(4) "C3_N" 85string(6) "NUMBER" 86int(2) 87int(-127) 88int(0) 89int(22) 90bool(false) 91string(4) "C4_D" 92string(4) "DATE" 93int(12) 94int(0) 95int(0) 96int(7) 97