Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX export refers to the old App ID when using expOriginalIds after copy

GiliamBJan 10 2022 — edited Jan 12 2022

I am facing an issue with the application id's when exporting the application with original id's.
I have created a starter application, which is basically an application fully configured to our needs and can be copied when a new application needs to be build (from almost scratch).
So what a developer does is copy that starter application and assign a new application id.
Open Starter Application (998)
Choose task to copy the application (right side)
Assign a new application id
Assign a new application name (optional)
Press 'Next'
Press 'Copy Application' to confirm copy action
copy_app.pngAfter APEX finished the copy action, it will return to the new application 150 - My New Application. So far so good.
Now export this new application.
Press 'Export / Import' tile
Press 'Export'
Enable/turn on 'Export with Original IDs' (last option)
Press 'Export'
exxport_app.png
When the export is finished, open the generated export file with a proper file editor.

I expect a file called f150.sql, creating an application with id 150.
What I see is a file called f150.sql, trying to create an application with id 998... Which doesn't make sense to me
export_file.pngp_default_application_id is 998 (shouldn't this be 150?)
See line 19, 26 and 29
I 've tried the following export method's:
APEX Export within APEX (as shown above)
Export/import without originalIds first and than again with originalIds
apex export -workspaceid 2220314826580950 -applicationid 150 -skipExportDate -expOriginalIds
The only thing that worked is removing the -expOriginalIds flag, but that changes all the other id's as well.
~Workaround:~
~For know I found a workaround, which is to export (without original id's) and then import once (reuse same app id).~
Update:
The workaround doesn't work.. When using the workaround, the export has the correct application id in the exported file, but when importing the file it tries to add a shared component with an id that already exists. This produces an error again.

Execution of the statement was unsuccessful. ORA-00001: unique constraint(APEX_210100.WWV_FLOW_LISTS_PK) violated

begin
  wwv_flow_api.create_list( p_id=>wwv_flow_api.id(23057559886838957) ,
                            p_name=>'Favorites' ,
                            p_list_type=>'SQL_QUERY' ,
                            p_list_query=>wwv_flow_string.join(wwv_flow_t_varchar2(...

The hint-text for parameter -expOriginalIds says
If specified, the application export will emit ids as they were when the application was imported
So I tried exporting/importing without originalIds first and than again with originalIds, same error.

It seems like it is not possible to export an app with originalIds, once it is copied/imported from another app_id. We are using apex 21.1.5, will try 21.2 in upcoming days.

With regards,
Giliam

This post has been answered by Christian Neumueller-Oracle on Jan 12 2022
Jump to Answer
Comments
Post Details
Added on Jan 10 2022
2 comments
1,483 views