2 oci_lob_write()/erase()/read() with BLOBs
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';
12 require dirname(__FILE__).'/create_table.inc';
14 $ora_sql = "INSERT INTO
15 ".$schema.$table_name." (blob)
21 $statement = oci_parse($c,$ora_sql);
22 $blob = oci_new_descriptor($c,OCI_D_LOB);
23 oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB);
24 oci_execute($statement, OCI_DEFAULT);
28 $str = "this is a biiiig faaat test string. why are you reading it, I wonder? =)";
29 var_dump($blob->write($str));
30 var_dump($blob->erase(0, 10));
34 $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE";
35 $s = oci_parse($c, $select_sql);
36 oci_execute($s, OCI_DEFAULT);
38 var_dump($row = oci_fetch_array($s));
40 var_dump($row[0]->read(5));
41 var_dump($row[0]->read(5));
42 var_dump($row[0]->read(5));
44 require dirname(__FILE__).'/drop_table.inc';
50 object(OCI-Lob)#%d (1) {
52 resource(%d) of type (oci8 descriptor)
58 object(OCI-Lob)#%d (1) {
60 resource(%d) of type (oci8 descriptor)
63 object(OCI-Lob)#%d (1) {
65 resource(%d) of type (oci8 descriptor)
68 string(5) "
\0\0\0\0\0"
69 string(5) "
\0\0\0\0\0"