descriptors.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. commit connection after destroying the descriptor
  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." (blob)
  16. VALUES (empty_blob())
  17. RETURNING
  18. blob
  19. INTO :v_blob ";
  20. $statement = oci_parse($c,$ora_sql);
  21. $blob = oci_new_descriptor($c,OCI_D_LOB);
  22. oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB);
  23. oci_execute($statement, OCI_DEFAULT);
  24. unset($blob);
  25. unset($statement);
  26. oci_commit($c);
  27. $ora_sql = "SELECT blob FROM ".$schema.$table_name." ";
  28. $statement = oci_parse($c,$ora_sql);
  29. oci_execute($statement, OCI_DEFAULT);
  30. var_dump($row = oci_fetch_assoc($statement));
  31. unset($row['BLOB']);
  32. oci_commit($c);
  33. require __DIR__.'/drop_table.inc';
  34. echo "Done\n";
  35. ?>
  36. --EXPECTF--
  37. array(1) {
  38. ["BLOB"]=>
  39. object(OCILob)#%d (1) {
  40. ["descriptor"]=>
  41. resource(%d) of type (oci8 descriptor)
  42. }
  43. }
  44. Done