oci_get_implicit_resultset — Returns the next child statement resource from a parent statement resource that has Oracle Database 12c Implicit Result Sets
Used to fetch consectutive sets of query results after the
execution of a stored or anonymous Oracle PL/SQL block where that
block returns query results with
Oracle's DBMS_SQL.RETURN_RESULT PL/SQL
function. This allows PL/SQL blocks to easily return query
results.
Child statements inherit their parent statement's prefetch value,
or it can be explicitly set with oci_set_prefetch().
인수
statement
A valid OCI8 statement identifier created
by oci_parse() and executed
by oci_execute(). The statement
identifier may or may not be associated with a SQL statement
that returns Implicit Result Sets.
반환값
Returns a statement handle for the next child statement available
on statement. Returns FALSE when child
statements do not exist, or all child statements have been returned
by previous calls
to oci_get_implicit_resultset().
예제
Example #1 Fetching Implicit Result Sets in a loop
$sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;';
$sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;';
$sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;';