Skip to main content

Though APEX Export commands have existed for years, I feel that the more recent added options have gone somewhat unnoticed.  If you’ve never attempted to do standard version control in APEX, you wouldn’t be alone.  For the longest time, you could only get one massive SQL-generated file from exporting an APEX app.

Everything changed when an entire list of commands got added to APEX Export, and they got even better when they became a part of SQLcl.

These additions now make it possible to download an APEX app, split it into multiple files, and run comparisons on the files to see what changed.  To my amazement, and despite efforts from the Oracle APEX community to spread this knowledge, this still remains unknown to too many people that regularly work with APEX.

It’s possible that the cause is due to APEX developers being a different breed, or that APEX people have not bothered to check this out because they already have an established alternative solution.  Regardless, I will guide you through this process in the hopes that your version control guru will no longer be legally required to attend anger management classes.

Setup

  • When you connect to your database in SQL Developer, check out your preferences to make sure they are correct
  • /Preference/Database/Utilities/Export
  • Change the directory to a place where you want to store the files
  • Exit when you are finished

Find Your Schema and Application

  • Depending on what you’re logged in as, you will do one of two things:
    1. On the left-hand side, open up Application Express and then the application you want to export
    2. On the left-hand side, open Other Users, find your schema, and then the application you want to export

Quick DDL to File

  • Right click on the application you want to export, select Quick DDL and Save to File
  • Give the file a name and continue. In my case, I named the file Bookstrut because I totally didn’t see the application was named Brookstrut

Prepare to Export

  • In the newly created Bookstrut.sql window, or whatever you named the file, enter the following code (change the application id to whatever the id of your application is)

Export

  • Run the code
  • Select the database connection and click OK

Explore

  • Find your file and confirm that it was downloaded properly
  • Open it up and look at how everything is organized

Now What?

  • You have an APEX app exported to a folder and categorically arranged
  • This form of exporting / importing is not going away and is poised to become more integral to APEX in future versions, which means:
    1. If you don’t have a set of practices for lifecycle management, now would a good time to talk about it
    2. If a system is in place, it again might be a good time to talk about comparing what you have in place with what this is capable of doing

 

 

References:
https://oracle-base.com/articles/misc/apexexport
https://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-life-cycle-management-wp-3030229.pdf

Requirements:
– APEX 5x or higher

Disclaimer:
We do not take responsibility for any unintended or unwanted consequences in your instance of Oracle, Oracle APEX, or related products as a result of reading our blogs or following our guides.  Though the information is fully tested and generally safe to use, our lawyers really have a thing against admitting potential wrongdoing.  If it makes you feel any better, I regularly head into their office to adjust all of their chairs, so they lean uncomfortably forward.  They are so busy during the day that they don’t even bother to fix it.  When you walk by and look at them, you’d swear they were in a room with a different gravitational pull.