Oracle Application Express or APEX, is a low-code web application development tool used in conjunction with the Oracle database. That means you can use it to develop web pages and applications while writing very little code, which is great if you are the type that likes writing little to no code, or at least appreciates the convenience that comes with it. Me? I am more of the latter. And there are some things that APEX can do very well even with no code.
If you have an Oracle database then APEX comes licensed with that, so you can use it for free. If you are also using Oracle Business Intelligence solutions (OBIEE), then APEX is a far slicker alternative to write-back tables. Secondly, if you have a table or view you would like to expose as a report without pulling it into an RPD, consider using APEX instead of going with a direct database query. An APEX “Classic Report” feels more user-friendly out-of-the-box than a basic analysis does. Also, you would need to do a little more in BI to match it feature-for-feature.
In a series of blog posts, which I will call “Chapters,” we will build out a simple app that showcases some of most basic things you should know to get started using APEX.
In preparation for this app we will use some test tables and data. Scripts can be downloaded here. The demo “schema” is for an expense management app. The table “app_expenses” has a list of all the expenses submitted by users. Expenses are submitted by expense type and cost center. The table “app_expense_types” is the lookup table for expense types, and “table app_cost_centers” is the lookup table for cost centers. Finally, the expense has a status, and “table app_expense_statuses” is the look up table for those.
Create an Application
Assuming you have access to an APEX environment, let’s get started. In this chapter, we will simply create a new application in APEX.
- Login to APEX, and then click on App Builder:
- We want to create a new application, so click on “Create.”
- We’ll choose the most common type of application – select “Desktop” and click on “Next.”
- Our app needs a name. Enter “Expenses App” in the “Name” field, and click on “Next.”
- We’ll start with just the default “Home” page, so make no changes and click on “Next.”
- Ensure “Copy Shared Components from Another Application” is set to “No”, and then click “Next.”
- To keep things simple, we will not use authentication in this app. So, change “Authentication Scheme” to “No Authentication”, and then click “Next.”
- Review your entries (the application number will be automatically assigned and could possibly be different from the screenshot) and then click on “Create
- APEX will now create the application and you should see this screen below:
- As the highlighted message says, your app has now been created. To run it, simply click on “Run Application” and it will open the application in a different browser tab so you can admire what you have achieved so far. It may not look like much, but at this point you have a functioning web app that comes fully deployed so you have a working URL as well. Pretty convenient.
A quick note on the URL. You can read about it here: https://docs.oracle.com/database/121/HTMDB/concept_url.htm#HTMDB03017 but the gist of it is that the URL has this format: http://APEX.somewhere.com/pls/APEX/f?p=4350:1:220883407765693447; this is the URL of your application: http://APEX.somewhere.com/pls/APEX/f?p=4350; and this is the URL to a particular page in your application: http://APEX.somewhere.com/pls/APEX/f?p=4350:1 (in this case the first page). The long number at the end is a session number which can change each time you access the application.
You will also notice that there is a black toolbar at the bottom of your new app. You see this if you are also logged into APEX in the same session as a developer (so your end-users will not see this). This toolbar offers a range of useful shortcuts that will take you back into APEX to edit the application, the page or via the “Quick Edit” option on the page. The “Theme Roller” is also a handy tool to try out at this point.
In the next chapter, we will add a new page to this app: a quickly created report on the “Expenses” table.