xref: /PHP-8.0/ext/oci8/tests/lob_034.phpt (revision ff66e494)
1--TEST--
2lob buffering - 2
3--SKIPIF--
4<?php
5$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
6require(__DIR__.'/skipif.inc');
7?>
8--FILE--
9<?php
10
11require __DIR__.'/connect.inc';
12require __DIR__.'/create_table.inc';
13
14$ora_sql = "INSERT INTO
15                       ".$schema.$table_name." (blob)
16                      VALUES (empty_blob())
17                      RETURNING
18                               blob
19                      INTO :v_blob ";
20
21$statement = oci_parse($c,$ora_sql);
22$blob = oci_new_descriptor($c,OCI_D_LOB);
23oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB);
24oci_execute($statement, OCI_DEFAULT);
25
26var_dump($blob->getBuffering());
27var_dump($blob->setBuffering(false));
28var_dump($blob->setBuffering(false));
29var_dump($blob->setBuffering(true));
30var_dump($blob->setBuffering(true));
31var_dump($blob->flush());
32var_dump($blob->flush(0));
33var_dump($blob->flush(-1));
34
35oci_commit($c);
36
37require __DIR__.'/drop_table.inc';
38
39echo "Done\n";
40
41?>
42--EXPECTF--
43bool(false)
44bool(true)
45bool(true)
46bool(true)
47bool(true)
48bool(true)
49bool(true)
50
51Warning: OCILob::flush(): Invalid flag value: -1 in %s on line %d
52bool(false)
53Done
54