4.24 INSTALL Procedure

Use this procedure to install an application. Use the APEX_APPLICATION_INSTALL_INSTALL.SET% procedures to configure installation parameters.

Syntax

PROCEDURE INSTALL (
    p_source             IN apex_t_export_files    default null,
    p_overwrite_existing IN BOOLEAN                default false );

Parameters

Table 4-5 INSTALL Parameters

Parameter Description

p_source

The source code, a table of (name, contents) with a single record for normal Oracle Applicatino Express applications or multiple records for applications that were split when exporting.

Note that passing multiple applications is not supported. If null (the default), import the source that was previously passed to GET_INFO.

p_overwrite_existing

If false (the default), raise an error instead of overwriting an existing application.

Raises

  • WWV_FLOW_IMP_PARSER.RUN_STMT_ERROR: The source contains invalid statements.

  • SECURITY_GROUP_ID_INVALID: The current workspace conflicts with the install workspace.

  • WWV_FLOW_API.FLOW_ID_RESERVED_FOR_OTHER_WORKSPACE: The application ID isused in another workspace.

  • WWV_FLOW_API.FLOW_ID_RANGE_RESERVED: The application ID is reserved internal us.

  • WWV_FLOW_API.FLOW_ID_OUT_OF_RANGE: The application ID used for installing is not in a valid range.

  • APPLICATION_ID_RESERVED: The application ID is in use in the current workspace and p_overwrite_existing was set to false.

Example

Fetch an application from a remote URL, then install it with a new ID and new component ID offsets in workspace EXAMPLE.

declare
    l_source apex_t_export_files;
    l_info   apex_application_install.t_file_info;
begin
    l_source := apex_t_export_files (
                    apex_t_export_file (
                         name     => 'f100.sql',
                         contents => apex_web_service.make_rest_request (
                                          p_url         => 'https://www.example.com/apps/f100.sql',
                                          p_http_method => 'GET' )));

    apex_util.set_workspace('EXAMPLE');
    apex_application_install.generate_application_id;
    apex_application_install.generate_offset;
    apex_application_install.install (
         p_source => l_source );
end;