xref: /PHP-8.1/ext/oci8/tests/lob_temp2.phpt (revision 72f47c0c)
1--TEST--
2Writing temporary lob before binding
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
8require(__DIR__.'/skipif.inc');
9?>
10--FILE--
11<?php
12
13require(__DIR__.'/connect.inc');
14require(__DIR__.'/create_table.inc');
15
16$ora_sql = "INSERT INTO ".$schema.$table_name." (clob) VALUES (:v_clob)";
17
18$clob = oci_new_descriptor($c, OCI_D_LOB);
19var_dump($clob->writeTemporary("test"));
20
21$statement = oci_parse($c, $ora_sql);
22oci_bind_by_name($statement, ":v_clob", $clob, -1, OCI_B_CLOB);
23oci_execute($statement, OCI_DEFAULT);
24
25$s = oci_parse($c, "select clob from ". $schema.$table_name);
26oci_execute($s);
27oci_fetch_all($s, $res);
28var_dump($res);
29
30?>
31--EXPECT--
32bool(true)
33array(1) {
34  ["CLOB"]=>
35  array(1) {
36    [0]=>
37    string(4) "test"
38  }
39}
40