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