Annotation of embedaddon/php/ext/oci8/tests/lob_016.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: returning multiple lobs
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:
13: $drop = "DROP table lob_test";
14: $statement = oci_parse($c, $drop);
15: @oci_execute($statement);
16:
17: $create = "CREATE table lob_test(lob_1 BLOB, lob_2 BLOB)";
18: $statement = oci_parse($c, $create);
19: oci_execute($statement);
20:
21: $init = "INSERT INTO lob_test VALUES(EMPTY_BLOB(), EMPTY_BLOB())";
22: $statement = oci_parse($c, $init);
23: oci_execute($statement);
24:
25: $select = "SELECT * FROM lob_test FOR UPDATE";
26: $statement = oci_parse($c, $select);
27: oci_execute($statement, OCI_DEFAULT);
28:
29: $row = oci_fetch_assoc($statement);
30:
31: $row['LOB_1']->write("first");
32: $row['LOB_2']->write("second");
33:
34: unset($row);
35:
36: oci_commit($c);
37:
38: $select = "SELECT * FROM lob_test FOR UPDATE";
39: $statement = oci_parse($c, $select);
40: oci_execute($statement, OCI_DEFAULT);
41:
42: $row = oci_fetch_assoc($statement);
43:
44: var_dump($row);
45: var_dump($row['LOB_1']->load());
46: var_dump($row['LOB_2']->load());
47:
48: $drop = "DROP table lob_test";
49: $statement = oci_parse($c, $drop);
50: @oci_execute($statement);
51:
52: echo "Done\n";
53:
54: ?>
55: --EXPECTF--
56: array(2) {
57: ["LOB_1"]=>
58: object(OCI-Lob)#%d (1) {
59: ["descriptor"]=>
60: resource(%d) of type (oci8 descriptor)
61: }
62: ["LOB_2"]=>
63: object(OCI-Lob)#%d (1) {
64: ["descriptor"]=>
65: resource(%d) of type (oci8 descriptor)
66: }
67: }
68: string(5) "first"
69: string(6) "second"
70: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>