bug32325.phpt 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. Bug #32325 (Cannot retrieve collection using OCI8)
  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. // Initialize
  14. $stmtarray = array(
  15. "create or replace type bug32325_t as table of number"
  16. );
  17. oci8_test_sql_execute($c, $stmtarray);
  18. // Run test
  19. $collection = oci_new_collection($c, "BUG32325_T");
  20. $sql = "begin
  21. select bug32325_t(1,2,3,4) into :list from dual;
  22. end;";
  23. $stmt = oci_parse($c, $sql);
  24. oci_bind_by_name($stmt, ":list", $collection, -1, OCI_B_NTY);
  25. oci_execute($stmt);
  26. var_dump($collection->size());
  27. var_dump($collection->getelem(1));
  28. var_dump($collection->getelem(2));
  29. // Cleanup
  30. $stmtarray = array(
  31. "drop type bug32325_t"
  32. );
  33. oci8_test_sql_execute($c, $stmtarray);
  34. echo "Done\n";
  35. ?>
  36. --EXPECT--
  37. int(4)
  38. float(2)
  39. float(3)
  40. Done