2 oci_fetch_object() with CLOB and NULL
5 $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
6 require(dirname(__FILE__).'/skipif.inc');
11 require(dirname(__FILE__).'/connect.inc');
16 "drop table fetch_object_2_tab",
17 "create table fetch_object_2_tab (col1 number, col2 CLOB, col3 varchar2(15))",
18 "insert into fetch_object_2_tab values (123, '1st row col2 string', '1 more text')",
19 "insert into fetch_object_2_tab values (456, '2nd row col2 string', NULL)",
20 "insert into fetch_object_2_tab values (789, '3rd row col2 string', '3 more text')",
23 oci8_test_sql_execute($c, $stmtarray);
29 if (!($s = oci_parse($c, 'select * from fetch_object_2_tab order by 1'))) {
30 die("oci_parse(select) failed!\n");
33 if (!oci_execute($s)) {
34 die("oci_execute(select) failed!\n");
37 while ($row = oci_fetch_object($s)) {
43 if (!($s = oci_parse($c, 'select * from fetch_object_2_tab order by 1'))) {
44 die("oci_parse(select) failed!\n");
47 if (!oci_execute($s)) {
48 die("oci_execute(select) failed!\n");
51 while ($row = oci_fetch_object($s)) {
52 echo $row->COL1 . "\n";
53 echo $row->COL2->load(100) . "\n";
54 echo $row->COL3 . "\n";
60 "drop table fetch_object_2_tab"
63 oci8_test_sql_execute($c, $stmtarray);
70 object(stdClass)#%d (3) {
74 object(OCI-Lob)#%d (1) {
76 resource(%d) of type (oci8 descriptor)
79 string(11) "1 more text"
81 object(stdClass)#%d (3) {
85 object(OCI-Lob)#%d (1) {
87 resource(%d) of type (oci8 descriptor)
92 object(stdClass)#%d (3) {
96 object(OCI-Lob)#%d (1) {
98 resource(%d) of type (oci8 descriptor)
101 string(11) "3 more text"