Tuesday, February 23, 2021

My two cents on low code and APEX

Today was (again) a nice day. A sunny day with almost 20 degrees (Celsius), no clouds and just the right amount of wind. Perfect conditions to do some paragliding and after the flight, a cold beer with a friend. 

But there was something else that made my day. It was something that happened in the office. Today we got a visit from a young 18 years old future student. Next year he will go to college and he is still not sure which one or which direction. But he said, he is interested in programming and that is why I invited him to visit us. 

We started talking, and it went like this: 

Me: Do you know Oracle or databases.

Him: no

Me: OK, do you know anything about APEX

Him; no

Me: OK, what about PL/SQL, SQL, Java, ...

Him: no

And I thought to my self, this is perfect! My next question was: Do you know anything about ER diagrams? The answer was...No. And I thought to my self, even better...let's try to teach him and see how fast he can learn and even more important if he will understand the logic. 

So I started: Let's say we have departments and employees...I know this was a big gamble, talking about departments and employees to someone who is 18! Luckily he did not run away. We started to draw squares and connecting them with lines ( crows feet ). I could just see that he was following and in a few minutes he already extended the ER with new entities (posts,...). Great, he can learn fast and he can also understand the design. 

The next step, create tables. For someone who does not know Oracle or in this case even databases, this is a problem. For a smart kid like him, that is not a problem, but again it would take some time to learn.

But luckily we are working with APEX and part of APEX is Quick SQL. First things first! We need an environment where he will work. apex.oracle.com to the rescue and in under 5 minutes we were already in Quick SQL in the newly created workspace. First 10 minutes in Quick SQL I explained the basics of constraints, data types, not nulls and foreign keys. It was just to connect what he already learned when drawing the ER diagram. Then I asked him to describe to me the database model and we have used this for Quick SQL...automagically code was generated on the fly. He did not know a single thing about Oracle and yet he was able to create tables ( physical model ). 

You can image what happened next. We run the script and based on the script we created the APEX application (we all know how that goes). His words were, OK this is cool!

If I just compare this to how it was 20 years ago when I started to work with Oracle!

My main point of this blog post is not that someone can learn to be a developer in 2 hours. It will take a lot more than that. But today with the low code approach, with Quick SQL and APEX we have the option to show how interesting it can be to develop applications. Like this bright kid, he was able to build something useful really fast. We already agreed on the next steps which will include more details...and hopefully someday we will have a new bright APEX developer.

And to that I say, cheers (with the cold beer after the flight) !


Monday, May 27, 2019

Sample Data Sets in APEX

Sample data sets are something that I use very often. Either I'm trying out some new features, working on a presentation, preparing a workshop,...

For me still the favorite data set is the King with a salary of 5000...or in other words the SCOTT schema with a famous DEPT and EMP tables. If you have never heard about the SCOTT schema, then it must be that you are really really young :). In that case you can read more about SCOTT schema here. And if you don't know who Scott is, then check this link.

If we want to have this sample data set in our custom schema then we need a script that will create the tables along with the data. One of the places where we can get the script is for an example on Github.

But if we are working with APEX all we need are a few clicks and we are good to go. Once logged into APEX we have to select in the drop down menu :  Workshop > Utilities > Sample DataSets

Once this page, all we have to do is click on "Install" next to EMP / DEPT and that is it. 

And that would be it, if this wouldn't be APEX. As you might already noticed there are multiple data sets available. In addition to DEPT / EMP we can also install Project Data, HR Data and Task Spreadsheet data sets. And if you look closer there is one more really nice thing about this DEPT / EMP data set. You can install the data in different languages...and that is 10 different languages! 

And things don't end here. After we are done with the installation of data set, we can simply create an application. 

Not sure if you are surprised, but not just the data, also the application it self will be generated in a selected language. 

If you wonder if we can have multiple languages in the same data set, that is not ( yet ) possible. At the moment only a single language can be loaded into the sample database objects. If you select a different language the currently loaded data will be replaced.


Friday, May 24, 2019

Page Specific Utilities

First things first. Yes, it' has been to long since I wrote my last blog post. But you know what, it's not like I didn't had time or something like that...it was just that I lost my login credentials for blogger.com...

Today I walked to the office and suddenly I remembered what my credentials are, and I also got an idea for a new blog post. Maybe it was due to the fact that it was a really nice walk...who knows :)

I'm working with APEX for many years now and here and there I "discover" things that are there, I guess for ages, but somehow I have overlooked them. My last presentation that I did was "It's good to know your APEX backyard" for the APEX Alpe Adria conference. In this presentation I talked about that APEX is not only Page Designer, where we spend most of our time when working with APEX. But there is so much more then Page Designer. As part of the presentation I also covered Application Utilities and on the page with Page Utilities you can see utilities like Application Dashboard, Upgrade Application,... But for me the best part was/is, the part rounded with the red color: Page Specific Utilities

For me this was a really nice discovery. Why discovery? I would say that you don't notice ( maybe it's just me ) the Page Specific Utilities right away. They are there on the page but a bit left out on the side and I would really like to see them more visible. Simply because they are so useful. So take a bit of your time to check them out, it's worth it. 

I will not cover all the Page Specific Utilities in this blog post, I will just highlight my personal top 3. 

1. Region Utilities > Grid Edit all No Data Found Messages

With this you can edit ALL "No Data Found" messages on a single page.

2. Process Utilities > Grid Edit of all Process Messages

Similar to the previous, only that in this case you can edit all Process messages...again on a single page.

3. Region Utilities > Update Interactive Report Settings

This is actually my favorite Page Specific Utility. You can see Interactive Report Settings of all Interactive reports and you can also manipulate this settings...again on a single page. 


Monday, March 13, 2017

Fixing Skillbuilders Super LOV (v3) in APEX 5.1

We have already migrated some of the existing applications to a new version of Oracle Application Express - 5.1. After few weeks in production I can just say...do it :). But when doing an upgrade there is always a possibility that you will hit some issues. For me one of the issue was Skillbuilders Super LOV (v3), and it looks like I'm not alone (https://community.oracle.com/thread/4010580)

So what is the issue? 

When you select a value (Super LOV item) and try to save a form then the value is not submitted. Now if you are lucky, then your item is mandatory and you will see the error - end users will tell you right away that something is not working. If your item is not mandatory then you might see this error much later, with complaints that some data is not saved correctly.

Value is selected
After submit, value is cleared and we see an error

After a bit of research I have found a quick fix, that you can use, until the plugin is fixed by original authors. What has to be done is just one small change in plugin's render function. Search in the source for line with disabled="disabled" (should be somewhere in line 157, if you haven't done some changes)

THEN 'disabled="disabled" onfocus="this.blur();"'

and change it to:

THEN 'readonly="readonly" onfocus="this.blur();"'

Notice the change is line 157 and 158

It looks like that something has changed from version 5.0 to 5.1. If you have an item with a property disabled="disabled", then after submitting the page you will not see value for this item.

To test this, I have created an After Submit Process with the code:

apex_debug.error('Value of P2_LOV : %s', :P2_LOV);

I have tried this on version 5.0.4 and 5.1 and after checking the debug there is a clear difference:

Debug in APEX 5.0

Debug in APEX 5.1


Saturday, March 4, 2017

Using APIs to set Application and Build Status in Oracle Application Express 5.1

In Oracle Application Express it is possible to specify application-level attributes: Build Status and Application Status. With Build Status we can prevent that an application is being modified by other developers. With Application Status we can specify whether an application is available or unavailable for use.

Topic of this blog post is not to talk in detail about this two attributes (if you want to know more, then check the official documentation), but to mention how we can use APIs to manage this attributes in Oracle Application Express 5.1

Build Status

For setting build status we can use the following procedure:

     p_application_id IN NUMBER,
     p_build_status IN VARCHAR2);

For p_build_status we can specify RUN_ONLY  and RUN_AND_BUILD.  More details about this API can be found here.

Application Status

For changing the status of the application, we can use the following procedure:

        p_application_id IN NUMBER,
        p_application_status IN VARCHAR2,
        p_unavailable_value IN VARCHAR2,
        p_restricted_user_list IN VARCHAR2); 

I don't want to do a copy/paste from the official documentation, so please check this link for parameters description and examples. 


Wednesday, February 8, 2017

New Look & Feel for Radio Group in Oracle Application Express 5.1

With Oracle Application Express version 5.1 we are getting lots of new features. Among most notable or exposed are for sure Interactive Grids, JET Charts and Live Template Options. But we can also find some smaller (and really nice) enhancements. One of this is new look and feel of Radio Group item. We can spot this for example when we use Create New Page wizard in Page Designer:

So what do we need to do, if we want to have this look and feel in our applications. Just adding combo box item to our page is not enough, it will have the same effect as in version 5.0. It will look like this :

Basically we need to change three things.

  • Number of Columns: should match number of elements in group or you can also set it to some bigger value (for example 100)
  • Display Null Value: NO 

  • Template Option -> Region Group Display: Display as Pill Button

After this three small changes we now have new look and feel for our radio group:

For me personally the same page looks much nicer now. And if you want, you can also try all the other template options (do it with Live Template Options, so that you see the effect on the fly) for radio group item and tweak the look and feel even further.


Friday, December 16, 2016

Change image prefix when using ORDS in standalone mode

In Oracle Application Express we can specify instance wide image prefix ( we provide this when installing APEX or later if we run apex/utilities/reset_image_prefix.sql ). Purpose of this blog post in not to explain what image prefix is, but if you would like to know more about it, then I recommend that you read a blog post from Joel Kallman - Image Prefix changes in Oracle Application Express 4.2.2

My blog post is about what we need to do, if we are changing image prefix and at the same time we are using Oracle REST Data Services (ORDS) in standalone mode. If we need to change image prefix, first thing is to run apex/utilities/reset_image_prefix.sql script and here we specify new image prefix - for example /i_test/

After this change when accessing APEX login page we will see this warning:

I find this warning very useful. It's telling us that we have to verify that we have copied images directory to right location and also that our new path is /i_test/. In case when we are using ORDS in standalone mode there is no need to copy anything, but we need to adjust standalone.static.context.path parameter in ORDS standalone.properties configuration file.

After this change, do a restart of ORDS and that is it.