User's Manual
Using PL/SQL Ref Cursors to Return Result Sets
Beta Draft Executing Stored Procedures and Functions 6-5
</tr>
END;
// Write one row per employee
foreach ($employeerecords as $emp) {
echo '<tr>';
echo '<td><input type="radio" name="emprec"
value="'.htmlentities($emp['EMPLOYEE_ID']).'"></td>';
echo '<td align="right">'.htmlentities($emp['EMPLOYEE_ID']).'</td>';
echo '<td>'.htmlentities($emp['EMPLOYEE_NAME']).'</td>';
echo '<td>'.htmlentities($emp['HIRE_DATE']).'</td>';
echo '<td align="right">'.htmlentities($emp['SALARY']).'</td>';
echo '<td align="right">'.htmlentities($emp['COMMISSION_PCT']).'</td>';
echo '<td align="right">'.htmlentities($emp['REMUNERATION']).'</td>';
echo '</tr>';
}
13. Save the changes to your application files. In a browser, enter the following URL to
test the application:
http://localhost/~<username>/chap6/anyco.php
14. In the Departments form, click Show Employees.
In the Employees page for the department, the employee remuneration is
displayed in the last column:
Using PL/SQL Ref Cursors to Return Result Sets
Data sets can be returned as REF CURSORS from PL/SQL blocks in a PHP script. This
can be useful where the dataset requires complex functionality.
A REF CURSOR in PL/SQL is a type definition that is assigned to a cursor variable. It
is common to declare a PL/SQL type inside a package specification for reuse in other
PL/SQL constructs, such as a package body.
To create a PL/SQL package specification and body, with a REF CURSOR to retrieve
employees for a specific department, perform the following steps: