Wednesday, June 27, 2018

APEX 18.1: No need for configuration tables any more

There's probably no application that doesn't need some kind of configuration table for storing different data across different environments (development/test/production) - like URL to the report server, configuration parameters and stuff like that.

Before APEX 18.1 in most cases I would create some simple key-value configuration table, set procedure and get function...repeating same task over and over again.

From APEX 18.1 you don't have to do that anymore. There's new feature called Application Settings.

There are two ways to manage Application Settings. One is from the Application Builder (Shared Components):


You can define several properties there, but the one I like the most is On Upgrade Keep Value. If set to Yes it will keep the setting value upon application upgrade. That means that you can export your application from the development environment and import it to the other environments without any worries that parameter values will be overridden.

There's also API to control those parameters from PL/SQL. There's new package apex_app_setting with set_value procedure and get_value function. For more info see documentation.

Enjoy!