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

1.1     ! misho       1: --TEST--
        !             2: ocifetchinto() & wrong number of params
        !             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, string) VALUES (1, 1, NULL)";
        !            15: 
        !            16: if (!($s = oci_parse($c, $insert_sql))) {
        !            17:        die("oci_parse(insert) failed!\n");
        !            18: }
        !            19: 
        !            20: for ($i = 0; $i<20; $i++) {
        !            21:        if (!oci_execute($s)) {
        !            22:                die("oci_execute(insert) failed!\n");
        !            23:        }
        !            24: }
        !            25: 
        !            26: if (!oci_commit($c)) {
        !            27:        die("oci_commit() failed!\n");
        !            28: }
        !            29: 
        !            30: $select_sql = "SELECT * FROM ".$schema."".$table_name."";
        !            31: 
        !            32: if (!($s = oci_parse($c, $select_sql))) {
        !            33:        die("oci_parse(select) failed!\n");
        !            34: }
        !            35: 
        !            36: if (!oci_execute($s)) {
        !            37:        die("oci_execute(select) failed!\n");
        !            38: }
        !            39: var_dump(ocifetchinto($s));
        !            40: var_dump($all);
        !            41: var_dump(ocifetchinto($s, $all, OCI_ASSOC, 5));
        !            42: var_dump($all);
        !            43: var_dump(ocifetchinto($c, $all, OCI_RETURN_LOBS));
        !            44: var_dump($all);
        !            45: var_dump(ocifetchinto($s, $all, 1000000));
        !            46: var_dump($all);
        !            47: 
        !            48: require dirname(__FILE__).'/drop_table.inc';
        !            49:        
        !            50: echo "Done\n";
        !            51: ?>
        !            52: --EXPECTF--
        !            53: Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d
        !            54: NULL
        !            55: 
        !            56: Notice: Undefined variable: all in %s on line %d
        !            57: NULL
        !            58: 
        !            59: Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d
        !            60: NULL
        !            61: NULL
        !            62: 
        !            63: Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d
        !            64: bool(false)
        !            65: NULL
        !            66: int(5)
        !            67: array(2) {
        !            68:   [0]=>
        !            69:   string(1) "1"
        !            70:   [1]=>
        !            71:   string(1) "1"
        !            72: }
        !            73: Done

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