--TEST-- Prefetch with REF cursor. Test different values for prefetch with oci_set_prefetch(). --SKIPIF-- (11\.2|12\.)/', $phpinfo); if ($iv == 1) { $sv = oci_server_version($c); $sv = preg_match('/Release 1[012]\./', $sv, $matches); if ($sv != 1) { die ("skip expected output only valid when using Oracle 10g or greater server"); } } else { die ("skip expected output only valid when using Oracle 11.2 or greater client"); } ?> --FILE-- --EXPECTF-- ----------------------------------------------- Test with Prefetch value set to 0 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "1" %unicode|string%(%d) "test1" ----------------------------------------------- Test with Prefetch value set to 1 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "2" %unicode|string%(%d) "test2" ----------------------------------------------- Test with Prefetch value set to 501 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Warning: oci_execute(): ORA-01002: %s ORA-06512: at "SYSTEM.REFCURPKG", line %d ORA-06512: at line %d in %s on line %d Fetch Row from PL/SQL NULL NULL ----------------------------------------------- Test with Prefetch value set to 499 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "500" %unicode|string%(%d) "test500" ----------------------------------------------- Test with Prefetch value set to 250 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "251" %unicode|string%(%d) "test251" ----------------------------------------------- Test with Prefetch value set to 12345 ----------------------------------------------- Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Warning: oci_execute(): ORA-01002: %s ORA-06512: at "SYSTEM.REFCURPKG", line %d ORA-06512: at line %d in %s on line %d Fetch Row from PL/SQL NULL NULL ----------------------------------------------- Test with Prefetch value set to -12345 ----------------------------------------------- Warning: oci_set_prefetch(): Number of rows to be prefetched has to be greater than or equal to 0 in %s on line %d Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "101" %unicode|string%(%d) "test101" ----------------------------------------------- Test with Prefetch value set to -1 ----------------------------------------------- Warning: oci_set_prefetch(): Number of rows to be prefetched has to be greater than or equal to 0 in %s on line %d Fetch Row from PHP array(2) { [0]=> %unicode|string%(%d) "0" [1]=> %unicode|string%(%d) "test0" } Fetch Row from PL/SQL %unicode|string%(%d) "101" %unicode|string%(%d) "test101" Done