Annotation of embedaddon/php/ext/oci8/tests/field_funcs_old.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ocicolumn*() family
! 3: --SKIPIF--
! 4: <?php
! 5: $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
! 6: require(dirname(__FILE__).'/skipif.inc');
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: require dirname(__FILE__)."/connect.inc";
! 12: require dirname(__FILE__).'/create_table.inc';
! 13:
! 14: $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)";
! 15:
! 16: if (!($s = ociparse($c, $insert_sql))) {
! 17: die("ociparse(insert) failed!\n");
! 18: }
! 19:
! 20: for ($i = 0; $i<3; $i++) {
! 21: if (!ociexecute($s)) {
! 22: die("ociexecute(insert) failed!\n");
! 23: }
! 24: }
! 25:
! 26: if (!ocicommit($c)) {
! 27: die("ocicommit() failed!\n");
! 28: }
! 29:
! 30: $select_sql = "SELECT * FROM ".$schema."".$table_name."";
! 31:
! 32: if (!($s = ociparse($c, $select_sql))) {
! 33: die("ociparse(select) failed!\n");
! 34: }
! 35:
! 36: if (!ociexecute($s)) {
! 37: die("ociexecute(select) failed!\n");
! 38: }
! 39:
! 40: ocifetchinto($s, $row, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
! 41: var_dump($row);
! 42:
! 43: foreach ($row as $num => $field) {
! 44: $num++;
! 45: var_dump(ocicolumnisnull($s, $num));
! 46: var_dump(ocicolumnname($s, $num));
! 47: var_dump(ocicolumntype($s, $num));
! 48: var_dump(ocicolumntyperaw($s, $num));
! 49: var_dump(ocicolumnscale($s, $num));
! 50: var_dump(ocicolumnprecision($s, $num));
! 51: var_dump(ocicolumnsize($s, $num));
! 52: }
! 53:
! 54:
! 55: require dirname(__FILE__).'/drop_table.inc';
! 56:
! 57: echo "Done\n";
! 58:
! 59: ?>
! 60: --EXPECT--
! 61: array(5) {
! 62: [0]=>
! 63: string(1) "1"
! 64: [1]=>
! 65: string(1) "1"
! 66: [2]=>
! 67: NULL
! 68: [3]=>
! 69: NULL
! 70: [4]=>
! 71: NULL
! 72: }
! 73: bool(false)
! 74: string(2) "ID"
! 75: string(6) "NUMBER"
! 76: int(2)
! 77: int(-127)
! 78: int(0)
! 79: int(22)
! 80: bool(false)
! 81: string(5) "VALUE"
! 82: string(6) "NUMBER"
! 83: int(2)
! 84: int(-127)
! 85: int(0)
! 86: int(22)
! 87: bool(true)
! 88: string(4) "BLOB"
! 89: string(4) "BLOB"
! 90: int(113)
! 91: int(0)
! 92: int(0)
! 93: int(4000)
! 94: bool(true)
! 95: string(4) "CLOB"
! 96: string(4) "CLOB"
! 97: int(112)
! 98: int(0)
! 99: int(0)
! 100: int(4000)
! 101: bool(true)
! 102: string(6) "STRING"
! 103: string(8) "VARCHAR2"
! 104: int(1)
! 105: int(0)
! 106: int(0)
! 107: int(10)
! 108: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>