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