![]() Previous |
![]() Next |
Use this procedure to create a collection from a supplied query. This method is identical to CREATE_COLLECTION_FROM_QUERY, however, the first 5 columns of the SELECT clause must be numeric and the next 5 must be date. After the numeric and date columns, there can be up to 50 character columns in the SELECT clause. The query will be parsed as the application owner. If a collection exists with the same name for the current user in the same session for the current Application ID, an application error is raised.
Syntax
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY2 (
p_collection_name IN VARCHAR2,
p_query IN VARCHAR2,
p_generate_md5 IN VARCHAR2 default 'NO');
Parameters
Table: CREATE_COLLECTION_FROM_QUERY2 Procedure Parameters describes the parameters available in the CREATE_COLLECTION_FROM_QUERY2 procedure.
CREATE_COLLECTION_FROM_QUERY2 Procedure Parameters
| Parameter | Description |
|---|---|
|
|
The name of the collection. The maximum length is 255 characters. An error is returned if this collection exists with the specified name of the current user and in the same session. |
|
|
Query to executed in order to populate the members of the collection. If p_query is numeric, it is assumed to be a DBMS_SQL cursor. |
|
|
Valid values include |
Example
The following example shows how to use the CREATE_COLLECTION_FROM_QUERY2 procedure to create a collection named EMPLOYEE and populate it with data from the EMP table. The first five columns (mgr, sal, comm, deptno, and null) are all numeric. Because p_generate_md5 is 'NO', the MD5 checksum is not computed.
begin;
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY2 (
p_collection_name => 'EMPLOYEE',
p_query => 'select empno, sal, comm, deptno, null, hiredate, null, null, null, null, ename, job, mgr from emp',
p_generate_md5 => 'NO');
end;