uawdijnntqw1x1x1
IP : 216.73.216.136
Hostname : dhandapanilive
Kernel : Linux dhandapanilive 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
html
/
oci8-3.0.1
/
tests
/
lob_020.phpt
/
/
--TEST-- oci_lob_write()/erase()/read() with CLOBs --SKIPIF-- <?php $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs require(__DIR__.'/skipif.inc'); ?> --FILE-- <?php require __DIR__.'/connect.inc'; require __DIR__.'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (Clob) VALUES (empty_Clob()) RETURNING clob INTO :v_clob "; $statement = oci_parse($c,$ora_sql); $clob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_clob", $clob,-1,OCI_B_CLOB); oci_execute($statement, OCI_DEFAULT); var_dump($clob); $str = "this is a biiiig faaat test string. why are you reading it, I wonder? =)"; var_dump($clob->write($str)); var_dump($clob->erase(10,20)); oci_commit($c); $select_sql = "SELECT clob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump($row[0]->read(2)); var_dump($row[0]->read(5)); var_dump($row[0]->read(50)); var_dump($clob->erase()); echo "\nInvalid values\n"; echo "\nTest 1\n"; try { var_dump($clob->erase(-10)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 2\n"; try { var_dump($clob->erase(10,-20)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 3\n"; try { var_dump($clob->erase(-10,-20)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 4\n"; try { // ORA-22990: LOB locators cannot span transactions var_dump(oci_lob_erase($clob)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 5\n"; try { var_dump(oci_lob_erase($clob,-10)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 6\n"; try { var_dump(oci_lob_erase($clob,10,-20)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 7\n"; try { var_dump(oci_lob_erase($clob,-10,-20)); } catch (ValueError $e) { echo $e->getMessage(), "\n"; } echo "\nTest 8\n"; unset($clob->descriptor); var_dump(oci_lob_erase($clob,10,20)); require __DIR__.'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCILob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(77) int(20) array(2) { [0]=> object(OCILob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["CLOB"]=> object(OCILob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } string(2) "" string(5) "th" string(50) "is st string. why are you read" Warning: OCILob::erase(): ORA-22990: %s in %s on line %d bool(false) Invalid values Test 1 OCILob::erase(): Argument #1 ($offset) must be greater than or equal to 0 Test 2 OCILob::erase(): Argument #2 ($length) must be greater than or equal to 0 Test 3 OCILob::erase(): Argument #1 ($offset) must be greater than or equal to 0 Test 4 Warning: oci_lob_erase(): ORA-22990: %s in %s on line %d bool(false) Test 5 oci_lob_erase(): Argument #2 ($offset) must be greater than or equal to 0 Test 6 oci_lob_erase(): Argument #3 ($length) must be greater than or equal to 0 Test 7 oci_lob_erase(): Argument #2 ($offset) must be greater than or equal to 0 Test 8 Warning: oci_lob_erase(): Unable to find descriptor property in %s on line %d bool(false) Done
/var/www/html/oci8-3.0.1/tests/lob_020.phpt