16.1 GET_APPLICATION Function

This function exports the given application. Optionally, split the application definition into multiple files. The optional p_with_% parameters can be used to include additional information in the export.

Syntax

FUNCTION GET_APPLICATION (
     p_application_id          IN NUMBER,
     p_split                   IN BOOLEAN             DEFAULT FALSE,
     p_with_date               IN BOOLEAN             DEFAULT FALSE,
     p_with_ir_public_reports  IN BOOLEAN             DEFAULT FALSE,
     p_with_ir_private_reports IN BOOLEAN             DEFAULT FALSE,
     p_with_ir_notifications   IN BOOLEAN             DEFAULT FALSE,
     p_with_translations       IN BOOLEAN             DEFAULT FALSE,
     p_with_pkg_app_mapping    IN BOOLEAN             DEFAULT FALSE,
     p_with_original_ids       IN BOOLEAN             DEFAULT FALSE,
     p_with_no_subscriptions   IN BOOLEAN             DEFAULT FALSE,
     p_with_comments           IN BOOLEAN             DEFAULT FALSE,
     p_with_supporting_objects IN VARCHAR2            DEFAULT NULL,
     p_with_acl_assignments    IN BOOLEAN             DEFAULT FALSE,  
     p_components              IN apex_t_varchar2     DEFAULT NULL )
     RETURN apex_t_export_files;

Parameters

Table 16-1 GET_APPLICATION Function Parameters

Parameters Description

p_application_id

The application id.

p_split

If true, split the definition into discrete elements that can be stored in separate files. If false, the result is a single file.

p_with_date

If true, include export date and time in the result.

p_with_public_reports

If true, include public reports that a user saved.

p_with_private_reports

If true, include private reports that a user saved.

p_with_notifications

If true, include report notifications.

p_with_translations

If true, include application translation mappings and all text from the translation repository.

p_with_pkg_app_mapping

If true, export installed packaged applications  with references to the packaged application definition. If false, export   them as normal applications.

p_with_original_ids

If true, export with the IDs as they were when the application was imported.

p_with_no_subscriptions

If true, components contain subscription references.

p_with_comments

If true, include developer comments.

p_with_supporting_objects

If 'Y', export supporting objects. If 'I',automatically install on import. If 'N', do not export supporting objects. If null, the application's include in export deployment value is used.

p_with_acl_assignments

If true, export ACL user role assignments.

p_components

If not null, export only given components (array elements should be of form type:name, for example,PAGE:42 or MESSAGE:12345).

See view APEX_APPL_EXPORT_COMPS for components that can be exported.

RETURNS

A table of apex_t_export_file. Unless the caller passes p_split=>true to the function, the result will be a single file.

Example

This sqlplus code fragment spools the definition of application 100 into file f100.sql.

variable name varchar2(255)
variable contents clob
declare
   l_files apex_t_export_files;
begin
   l_files := apex_export.get_application(p_application_id => 100);
   :name := l_files(1).name;
   :contents := l_files(1).contents;
end;
/
set feed off echo off head off flush off termout off trimspool on
set long 100000000 longchunksize 32767
col name new_val name
select :name name from sys.dual;
spool &name.
print contents
spool off