Annotation of embedaddon/php/ext/oci8/tests/fetch_all1.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: oci_fetch_all()
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: require(dirname(__FILE__)."/connect.inc");
        !             9: 
        !            10: // Initialize
        !            11: 
        !            12: $stmtarray = array(
        !            13:     "drop table fetch_all_tab",
        !            14:     "create table fetch_all_tab (id number, value number)",
        !            15:     "insert into fetch_all_tab (id, value) values (1,1)",
        !            16:     "insert into fetch_all_tab (id, value) values (1,1)",
        !            17:     "insert into fetch_all_tab (id, value) values (1,1)"
        !            18: );
        !            19: 
        !            20: oci8_test_sql_execute($c, $stmtarray);
        !            21: 
        !            22: if (!($s = oci_parse($c, "select * from fetch_all_tab"))) {
        !            23:        die("oci_parse(select) failed!\n");
        !            24: }
        !            25: 
        !            26: /* oci_fetch_all */
        !            27: if (!oci_execute($s)) {
        !            28:        die("oci_execute(select) failed!\n");
        !            29: }
        !            30: var_dump(oci_fetch_all($s, $all));
        !            31: var_dump($all);
        !            32: 
        !            33: /* ocifetchstatement */
        !            34: if (!oci_execute($s)) {
        !            35:        die("oci_execute(select) failed!\n");
        !            36: }
        !            37: 
        !            38: var_dump(ocifetchstatement($s, $all));
        !            39: var_dump($all);
        !            40: 
        !            41: // Cleanup
        !            42: 
        !            43: $stmtarray = array(
        !            44:     "drop table fetch_all_tab"
        !            45: );
        !            46: 
        !            47: oci8_test_sql_execute($c, $stmtarray);
        !            48:        
        !            49: echo "Done\n";
        !            50: ?>
        !            51: --EXPECTF--
        !            52: int(3)
        !            53: array(2) {
        !            54:   [%u|b%"ID"]=>
        !            55:   array(3) {
        !            56:     [0]=>
        !            57:     %unicode|string%(1) "1"
        !            58:     [1]=>
        !            59:     %unicode|string%(1) "1"
        !            60:     [2]=>
        !            61:     %unicode|string%(1) "1"
        !            62:   }
        !            63:   [%u|b%"VALUE"]=>
        !            64:   array(3) {
        !            65:     [0]=>
        !            66:     %unicode|string%(1) "1"
        !            67:     [1]=>
        !            68:     %unicode|string%(1) "1"
        !            69:     [2]=>
        !            70:     %unicode|string%(1) "1"
        !            71:   }
        !            72: }
        !            73: int(3)
        !            74: array(2) {
        !            75:   [%u|b%"ID"]=>
        !            76:   array(3) {
        !            77:     [0]=>
        !            78:     %unicode|string%(1) "1"
        !            79:     [1]=>
        !            80:     %unicode|string%(1) "1"
        !            81:     [2]=>
        !            82:     %unicode|string%(1) "1"
        !            83:   }
        !            84:   [%u|b%"VALUE"]=>
        !            85:   array(3) {
        !            86:     [0]=>
        !            87:     %unicode|string%(1) "1"
        !            88:     [1]=>
        !            89:     %unicode|string%(1) "1"
        !            90:     [2]=>
        !            91:     %unicode|string%(1) "1"
        !            92:   }
        !            93: }
        !            94: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>