coll_011_func.phpt 913 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. collections and strings
  3. --SKIPIF--
  4. <?php
  5. $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
  6. require(dirname(__FILE__).'/skipif.inc');
  7. ?>
  8. --FILE--
  9. <?php
  10. require dirname(__FILE__)."/connect.inc";
  11. $ora_sql = "DROP TYPE
  12. ".$type_name."
  13. ";
  14. $statement = OCIParse($c,$ora_sql);
  15. @OCIExecute($statement);
  16. $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)";
  17. $statement = OCIParse($c,$ora_sql);
  18. OCIExecute($statement);
  19. $coll1 = ocinewcollection($c, $type_name);
  20. $coll2 = ocinewcollection($c, $type_name);
  21. var_dump(oci_collection_append($coll1, "string"));
  22. var_dump(oci_collection_append($coll1, "string"));
  23. var_dump(oci_collection_assign($coll2, $coll1));
  24. var_dump(oci_collection_element_get($coll2, 0));
  25. echo "Done\n";
  26. require dirname(__FILE__)."/drop_type.inc";
  27. ?>
  28. --EXPECT--
  29. bool(true)
  30. bool(true)
  31. bool(true)
  32. string(6) "string"
  33. Done