ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_STEP_UI_FK) violated when exporting/importing single page on APEX 4.2.1

Environment: Application Express 4.2.1.00.08, Oracle database 10.2.0.5.

We recently upgraded from APEX 4.1.1 to 4.2.1. The upgrade went fine, no problems were seen in the installation log files.

However, when I tried to export a single application page from one APEX 4.2.1 installation and import it into another APEX 4.2.1 installation, I received the following error:

ORA-20001: Error creating page name=”page01″ ORA-02291: integrity constraint APEX_040200.WWV_FLOW_STEP_UI_FK) violated – parent key not found

The application has the same application ID and workspace name. Individual page exports used to work fine on APEX versions prior to 4.2.

I searched the OTN forum and the Oracle support site and I found that this is a know issue with APEX 4.2.1.

I have you access to Oracle support, the problem is registered as bug 15922342.

This is from the bug report:

After upgrading the APEX instances on dev and prod to APEX 4.2 the single 
page export/import from dev into prod doesn’t work anymore. It fails with 
ORA-2291: integrity constraint (APEX_040200.WWV_FLOW_STEP_UI_FK) violated – 
parent key not found

Explain why this is not a bug:
Single component export/import is only supported for application which are 
identical on the source and target system. It relies on the fact that other 
referenced components (for example user interface, templates, …) use the 
same IDs on body systems.

Because of the APEX 4.2 upgrade, that’s not the case anymore. As part of the 
upgrade, several new components had to be created on the fly which do now 
have different IDs on dev and prod. That’s why the single component 
export/import doesn’t work anymore.

If the single component export/import is used to patch applications, it’s 
recommended to do a full export of the app on dev and import it into prod 
after upgrading to a newer version of APEX to make sure that body systems are 
using the same component IDs.”

There are 2 workarounds for this problem:

1) Find an existing ID in the table wwv_flow_user_interfaces on the database where you want to import. Update the export file, so you replace the ID in ‘p_user_interface_id => <id number>’ to the existing number in wwv_flow_user_interfaces.

2) Do a full export/import of the application first. After this, you will again be able to export/import individual pages.

I tried the second workaround, and this works fine! I don’t receive an error anymore when I export a single page to the other installation.

 

HTH,

Matthias

 

 

2 thoughts on “ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_STEP_UI_FK) violated when exporting/importing single page on APEX 4.2.1

  1. Hi. My name is Dip. I’m trying to import page to anothet app in the same workspace. If the exported page has regions, im getting error: WWV_FLOW_PAGE_PLUGS_PK.
    How did you import only one page with solution number 2, where you exported the whole application?

    Thanks.
    BR

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.