xref: /PHP-8.2/ext/oci8/tests/lob_032.phpt (revision b5a14e6c)
1--TEST--
2oci_lob_write() and friends
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
17                       ".$schema.$table_name." (id, clob)
18                      VALUES (2, empty_clob())
19                      RETURNING
20                               clob
21                      INTO :v_clob ";
22
23$statement = oci_parse($c,$ora_sql);
24$clob = oci_new_descriptor($c,OCI_D_LOB);
25oci_bind_by_name($statement,":v_clob", $clob,-1,OCI_B_CLOB);
26oci_execute($statement, OCI_DEFAULT);
27
28oci_commit($c);  // This will cause subsequent ->write() to fail
29$clob->write("data");
30
31require __DIR__.'/drop_table.inc';
32
33echo "Done\n";
34
35?>
36--EXPECTF--
37Warning: OCILob::write(): ORA-22990: %s in %s on line 19
38Done
39