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

1.1     ! misho       1: --TEST--
        !             2: Test oci_fetch_all with 0 and -1 skip & maxrows
        !             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: // Initialization
        !            11: 
        !            12: $stmtarray = array(
        !            13:        "drop table fetch_all5_tab",
        !            14:        "create table fetch_all5_tab (mycol1 number, mycol2 varchar2(20))",
        !            15:        "insert into fetch_all5_tab values (1, 'abc')",
        !            16:        "insert into fetch_all5_tab values (2, 'def')",
        !            17:        "insert into fetch_all5_tab values (3, 'ghi')"
        !            18: );
        !            19: 
        !            20: oci8_test_sql_execute($c, $stmtarray);
        !            21: 
        !            22: // Run Test
        !            23: 
        !            24: echo "Test 1\n";
        !            25: 
        !            26: $s = oci_parse($c, "select * from fetch_all5_tab order by 1");
        !            27: oci_execute($s);
        !            28: $r = oci_fetch_all($s, $res, 0, -1);
        !            29: var_dump($r);
        !            30: var_dump($res);
        !            31: 
        !            32: echo "Test 1\n";
        !            33: 
        !            34: $s = oci_parse($c, "select * from fetch_all5_tab order by 1");
        !            35: oci_execute($s);
        !            36: $r = oci_fetch_all($s, $res, 0, 0);
        !            37: var_dump($r);
        !            38: var_dump($res);
        !            39: 
        !            40: echo "Test 3\n";
        !            41: 
        !            42: $s = oci_parse($c, "select * from fetch_all5_tab order by 1");
        !            43: oci_execute($s);
        !            44: $r = oci_fetch_all($s, $res, -1, 0);
        !            45: var_dump($r);
        !            46: var_dump($res);
        !            47: 
        !            48: // Clean up
        !            49: 
        !            50: $stmtarray = array(
        !            51:        "drop table fetch_all5_tab"
        !            52: );
        !            53: 
        !            54: oci8_test_sql_execute($c, $stmtarray);
        !            55: 
        !            56: oci_close($c);
        !            57: 
        !            58: ?>
        !            59: ===DONE===
        !            60: <?php exit(0); ?>
        !            61: --EXPECTF--
        !            62: Test 1
        !            63: int(3)
        !            64: array(2) {
        !            65:   [%u|b%"MYCOL1"]=>
        !            66:   array(3) {
        !            67:     [0]=>
        !            68:     %unicode|string%(1) "1"
        !            69:     [1]=>
        !            70:     %unicode|string%(1) "2"
        !            71:     [2]=>
        !            72:     %unicode|string%(1) "3"
        !            73:   }
        !            74:   [%u|b%"MYCOL2"]=>
        !            75:   array(3) {
        !            76:     [0]=>
        !            77:     %unicode|string%(3) "abc"
        !            78:     [1]=>
        !            79:     %unicode|string%(3) "def"
        !            80:     [2]=>
        !            81:     %unicode|string%(3) "ghi"
        !            82:   }
        !            83: }
        !            84: Test 1
        !            85: int(3)
        !            86: array(2) {
        !            87:   [%u|b%"MYCOL1"]=>
        !            88:   array(3) {
        !            89:     [0]=>
        !            90:     %unicode|string%(1) "1"
        !            91:     [1]=>
        !            92:     %unicode|string%(1) "2"
        !            93:     [2]=>
        !            94:     %unicode|string%(1) "3"
        !            95:   }
        !            96:   [%u|b%"MYCOL2"]=>
        !            97:   array(3) {
        !            98:     [0]=>
        !            99:     %unicode|string%(3) "abc"
        !           100:     [1]=>
        !           101:     %unicode|string%(3) "def"
        !           102:     [2]=>
        !           103:     %unicode|string%(3) "ghi"
        !           104:   }
        !           105: }
        !           106: Test 3
        !           107: int(0)
        !           108: array(0) {
        !           109: }
        !           110: ===DONE===

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