Databases Reference
In-Depth Information
The process is not going any faster; it is still taking three seconds to complete, but
the user experience is better. The page will respond immediately after clicking on
the button. The only action that needs to be completed on the APEX page, before
giving control back to the user, is submitting the job. When the page process is done
with submitting the job, the user gets control back and can continue working with
the application.
Pipelined table functions
One of the key features of functions is that they return a value. This value can be
either a scalar value of a composite value such as a record or an object, or even a set
of values such as an associative array, a nested table, or a varray. A regular function
returns its value after the function is completely inished and the RETURN statement is
encountered. The program that calls a function will have to wait until the function is
inished with its task, before the caller can continue with processing.
A pipelined table function is slightly different. This type of function can return
values before the inal RETURN statement is encountered. This means that it can
return values for multiple times. This feature allows you to use a pipelined table
function in the FROM clause of a query.
First we will take a look at a small example, then we will look at how you can apply
this function in your APEX application.
A pipelined table function needs to return a collection type, such as a nested table
of varrays. This can be a collection of objects—if this is what you need. For this
example, we will keep things simple and create a collection of Varchar2 :
SQL> create or replace type time_list is
2 table of varchar2(10)
3 /
Type created.
Now, we need to create the function that returns the previously created collection
pipelined :
SQL> create or replace
2 function show_time
3 return time_list pipelined
4 is
5 begin
6 for i in 1..5
7 loop
 
Search WWH ::




Custom Search