lob_032.phpt 916 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. oci_lob_write() and friends
  3. --EXTENSIONS--
  4. oci8
  5. --SKIPIF--
  6. <?php
  7. $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
  8. require(__DIR__.'/skipif.inc');
  9. ?>
  10. --FILE--
  11. <?php
  12. require __DIR__.'/connect.inc';
  13. require __DIR__.'/create_table.inc';
  14. $ora_sql = "INSERT INTO
  15. ".$schema.$table_name." (id, clob)
  16. VALUES (2, empty_clob())
  17. RETURNING
  18. clob
  19. INTO :v_clob ";
  20. $statement = oci_parse($c,$ora_sql);
  21. $clob = oci_new_descriptor($c,OCI_D_LOB);
  22. oci_bind_by_name($statement,":v_clob", $clob,-1,OCI_B_CLOB);
  23. oci_execute($statement, OCI_DEFAULT);
  24. oci_commit($c); // This will cause subsequent ->write() to fail
  25. $clob->write("data");
  26. require __DIR__.'/drop_table.inc';
  27. echo "Done\n";
  28. ?>
  29. --EXPECTF--
  30. Warning: OCILob::write(): ORA-22990: %s in %s on line 19
  31. Done