1 Reply Latest reply on Jul 3, 2013 10:04 AM by Fanny__

    Export APEX application will not import to another APEX instance

      Oracle XE 11gR2
      APEX 4.1.1
      Windows 7

      Get the following error when trying to import (via SQL*Plus) an APEX application:

      ORA-02291: integrity constraint (APEX_040100.WWV_FLOWS_FK) violated - parent key not found
      ORA-06512: at "APEX_040100.WWW_FLOW_API", line 679
      ORA-06512: at line 3

      Used the following PL/SQL block to import APEX application:

      -- the name of the workspace in which to import -- actually your parsing schema
      t_workspace varchar2(30):= 'APEXAPP';
      -- an application number of an existing application in the workspace.
      t_existing_app number := 103;
      -- the "new" application number, an existing number will be dropped first.
      t_new_app number := 103;
      -- security group id, you don't have to set this variable
      t_secgrp_id number;

      -- get the Security Group ID
      select workspace_id
      into t_secgrp_id
      from apex_applications
      where application_id = t_existing_app;

      wwv_flow_api.set_security_group_id(p_security_group_id => t_secgrp_id);




      apex_application_install.set_application_alias('APEXAPP' );


      I recently did an upgrade from APEX 4.0.2 to 4.1.1 but there were no apps in this particular APEX instance. Just needed an upgrade because the APEX that
      comes with Oracle XE database is 4.0.2 and we are developing with APEX 4.1.1

      Please advise. This block has been used before to deploy APEX exports.