Skip to main content

Posts

Some conditions are more equal than others ...

Imagine you have a nice APEX application, but on a certain day your client asks you to remove a column from the application. So after a thorough dependency analysis it appears that that column is only used in two pages : One Interactive Report and one Form.  So you go ahead and start with the hard work and delete the column from the table. Now you only have to fix the application, right? So - just in case of "you never know whether the client will change his mind again" - you decide to set the "Server Side Condition" of the column in both the Report and the Form to "Never". That should do the trick! Of course you do test, and fire up the report. Works as expected, the column is not shown on the report anymore. Then you click the little pencil link to open the Form.  And an error pops up: WTF? I was pretty sure I set the Condition to Never! So why is it still trying to fetch that column? Luckily there are more ways to not show an Ite...

Kscope18 flashback

After a few nights of good sleep (that means more than the average 4 to 5 hours at Kscope), it is time to sit back and evaluate what happened last week. I arrived on Thursday night before the event, just in time to catch Danny Bryant at the bar for "just one last beer" (I don't know how often I heard, and used, that phrase last week). The whole Friday was filled with an all day Board Meeting, mainly discussing the future of ODTUG, a reception and a fine dinner. Since a couple of years, Saturday is the Community Service Day. This year, an impressive number of people showed up and were transferred to "Up Orlando", to make its easier for them to help the people that really need some help. All kinds of different activities were done, like cleaning, filling shelves, painting chairs etc.  After that there is another tradition: bag stuffing. All those (about 1500) bags didn't get delivered with all those goodies in there! A number of volunteers created the most ...

apex_application.g_f0x array processing in Oracle 12

If you created your own "updatable reports" or your custom version of tabular forms in Oracle Application Express, you'll end up with a query that looks similar to this one: then you disable the " Escape special characters " property and the result is an updatable multirecord form. That was easy, right? But now we need to process the changes in the Ename column when the form is submitted, but only if the checkbox is checked. All the columns are submitted as separated arrays, named apex_application.g_f0x - where the "x" is the value of the "p_idx" parameter you specified in the apex_item calls. So we have apex_application.g_f01, g_f02 and g_f03. But then you discover APEX has the oddity that the "checkbox" array only contains values for the checked rows. Thus if you just check "Jones", the length of g_f02 is 1 and it contains only the empno of Jones - while the other two arrays will contain all (14) rows. So for ...

Using multiple Authentication Schemes for your APEX application

Recently someone asked me how he could implement multiple authentication schemes for his APEX application. He would like to use (some kind of) Single Sign-on authentication and - as an alternative - an Application Express Authentication. The problem is ... you can only define one Authentication Scheme being "Current" for an application! So how can we solve this issue? First, we need te be aware that multiple applications can share their authentication by using the same cookie. Thus if you specify "MYCOOKIE" as the Cookie Name in Application A as well as in Application B, you can switch from A to B and back without the need of logging in again. It doesn't matter what Authentication Scheme Type you are using! Knowing this, we are halfway our solution. We need two Applications. One - the "real" application - using the Application Express Authentication, let's name this one "LAUNCHPAD". And another one using the Single Sign-on Authenticat...

Dockerize your APEX development environment

Nowadays Docker is everywhere. It is one of the main components of Continuous Integration / Continuous Development environments. That alone indicates Docker has to be seen more as a Software Delivery Platform than as a replacement of a virtual machine. However ... If you are running an Oracle database using Docker on your local machine to develop some APEX application, you will probably not move that container is a whole to test and production environments. Because in that case you would not only deliver a new APEX application to the production environment - which is a good thing - but also overwrite the data in production with the data from your development environment. And that won't make your users very excited. So in this set up you will be using Docker as a replacement of a Virtual Machine and not as a Delivery Platform. And that's exactly the way Martin is using it as he described in this recent blog post . It is an ideal way to get up and running with an Oracle d...

Refresh selected row(s) in an Interactive Grid

In my previous post I blogged about pushing changed rows from the dabatase into an Interactive Grid . The use case I'll cover right here is probably more common - and therefore more useful! Until we had the IG, we showed the data in a report (Interactive or Classic). Changes to the data where made by popping up a form page, making changes, saving and refreshing the report upon closing the dialog. Or by clicking an icon / button / link in your report that makes some changes to the data (like changing a status) and ... refresh the report.  That all works fine, but the downsides are: The whole dataset is returned from the server to the client - again and again. And if your pagination size is large, that does lead to more and more network traffic, more interpretation by the browser and more waiting time for the end user. The "current record" might be out of focus after the refresh, especially by larger pagination sizes, as the first rows will be shown. Or (even wors...

Push changed rows to an Interactive Grid

For pushing changes from the database to the end user, the regular solution is using websockets. A change in a record is detected - using a trigger or using the CQN (Change Query Notification) feature - and a notification is send to a websocket server. That websocket server broadcasts the notification over a channel to all browsers that are tuned in to that websocket channel. Then the browser reacts to that notification, usually showing an alert or refreshing a report. This trick is described on multiple sites, just Google for " oracle apex websockets " or similar. So back in the old days, we used that notification in the browser to refresh the (interactive) report. But along comes the Interactive Grid (IG) . While he full-refresh mechanism still works for IG, an IG has also the option to refresh just one row.  So wouldn't it be awesome that just the changed row(s) get refreshed upon a change in the database, instead of the whole report? Can we do it ... yes we ca...

A review of APEX World 2017 - Day 2

(You can read my impression of the first day here ) After a short but good night sleep and an excellent breakfast, Mike Hichwa delivered his second keynote " RAD Challenge: Build a Real World application in 60 minutes ”. Although he suffered from connection issues, Mike managed to wow the audience showing the new packaged app "Quick SQL” and  the new (currently Cloud-only) “Blueprint” option to create a new application. As JSON is not code (but just a collection of value-attribute pairs), it was really a  no-code showcase! Then it was parallel session time again and I went to see how Christian Rokitta would "Bootstrapify Universal Theme” . The message is: You don’t have to unsubscribe from the Universal Theme (and please don’t!) to create an application that looks totally different from the “regular” APEX applications. Then I had to deliver my second presentation “ Docker for Dummies ”. It was aimed at people who might...

A review of APEX World 2017 - Day 1

Last week the SS Rotterdam was the beautiful location of the largest gathering of APEX Developers worldwide. With around 380 (!) attendees a new high was set. And they came from all over the world : I spotted people from The Netherlands, Belgium, Switzerland, Austria, Croatia, Germany, Denmark, Norway, UK, Ireland and the USA. And I even might have missed one or two …. The event started with a presentation by the “father of APEX”, Mike Hichwa, talking about " Oracle APEX Past, Present and Future ”. Of course everyone is curious what the APEX future might bring: Friendly URL’s, automated testing, more JSON, concurrent APEX versions, third party Oauth 2 authentication (think Facebook, Google), APEX app diff and more, a lot more, REST capabilities. And now we have to wait for APEX 5.2 … and that might take a while!  After this keynote, the conference split up in three tracks. After the coffee break I returned to to big theatre where Geertjan Wielenga talked ...

EECS - Oracle Exadate Express Cloud Service, Step 4 : APEX !

So what are my experiences using EECS doing some APEX work? First of all, it is not blazing fast. Probably caused by the latency (as mentioned in my previous post). It is not slow, it is just ok('ish).  Second, and way more important, it runs APEX 5.0.4 ! So whatever Oracle advertises about " Cloud first " ... it doesn't seem to apply to APEX (or APEX on EECS). So this fact alone makes this environment useless for demo, development and presentation purposes at this moment. I heard through the grapevine that 5.1 will be available from April 25 - but that's still a month away. And that rumour could be false. Third, because you don't have access to a SYS account, you can't install something like APEX-SERT . Maybe the install scripts can be adapted for the PDB_ADMIN account - I haven't looked into that yet. Four : As mentioned in an earlier post, within an EECS PDB instance you get one and only one APEX Workspace. You can't add one (no...

EECS - Oracle Exadate Express Cloud Service, Step 3

Once you have defined your users for your Express Cloud Service, all users with the role of Database Developer or higher can access the database Service Console. From here all database related actions can be started. The upper category, Web Access, brings you to the specified part of the APEX builder - more on that in the next post. In the lower category you can create database schema's. For our goal within smart4apex, I created a schema for every developer. You can define whether the schema should be accessible from within APEX and creating an separate tablespace is optional. I haven't played around with the Document Store yet, so I have to skip that part. You can also set the password of the administrator of your PDB - the most privileged user within your PDB you have access to. Franck Pachot did an excellent writeup about the privileges of that user. I hoped the "Manage Application Express" would bring me to the "APEX Admin" environment - a.k.a. ...

EECS - Oracle Exadata Express Cloud Service, Step 2

Once you get your services up and running, you can log into your domain - in this screenhot "smart4apex" - on the Oracle Cloud. Then you'll end up in the "My Services" dashboard. As I have only one, my dashboard looks quite clean, showing just this widget: Just a few remarks for the designers of this: I am very curious why there is an extra " (Number of ..."  in the chart title. The same superflous text is also on another location on that page. And, more intriguing, what would "0.0323 database instances" mean? 1/0.0323 = 31. So something like days? But February has 28 days... It would make way more sense to just show here how many instances I had on those day (so, "1" al over the place...). From this widget you can drill into the "Service Details", where you can set rules and alerts and see the (historical) status of your instance. Funny thing is, I noticed this: These figures indicate, I have a storage limit ...

Intermittent ORA-06502 error when running APEX 5 on 12c

We upgraded our environment from 11.2 to 12c last week. This week we noticed an error in one of our APEX pages, a rather simple form for entering data. Nothing fancy, nothing spectacular - only a spectacular error when you tried to edit a record.  Running the page in debug mode (even on LEVEL9) wasn't very helpful as you can see below (10 points who immediately spots the error!). The error didn't occur for all records. It seems that a long(er) Code and Description field on the page resulted in an error more frequently. Also fiddling with a couple of the checkbox fields on the page had an effect. So I asked Twitter for help. And within a few minutes I got all kinds of tips and advice. But especially one, from Peter Raganitsch  was spot on. He suggested, looking at the debug output above, to take a look at the #CLOSE# position in the template. . My buttons are positioned in that #CLOSE# position, so I took a closer look at those. There were three that passed the Id, Co...

First steps using the Oracle Exadata Express Cloud Service

The Oracle Exadata Express Cloud Service was announced at Oracle Open World 2016. This service looks like an excellent use case for Oracle Database development purposes as well as setting up a test environment. And even for small to medium sized production situations it looks very promising as you can see in the table below. Especially the cheapest option offers a lot of bang for your bucks. But alas, this service was not as widely available as I expected. The first months it was US-only and you could only figure out by ordering the service and then you would find out on the last page that you should "contact your Oracle sales rep". I sincerely doubt whether he or she could provide you with that service, so I just waited until it would be more generally available. And since a few weeks the Oracle Exadata Express Cloud Service is also available in Europe - I don't know about other parts of the world. A missed chance though that Oracle didn't announce that proper...

OTN Nordic ACE Tour : A Tale of Three Cities

3 days - 3 cities - 6 presentations (4 different ones) My tour started on Monday afternoon when I left my house around 1.30PM to get on the bus to the train station. The 2PM train left exactly on time for the Amsterdam airport. I arrived at Schiphol around 3:30PM, perfectly on time to catch the 5PM flight to Copenhagen. The flight to Copenhagen was very uneventful. From the airport I took the train / metro into the city. I already received an email message from one of my co-travellers, Martin Widlake, who was sitting al alone in a bar downtown. The poor guy. So I rescued him and was briefly after that joined by Sten Vesterli - another ACE Director from the organising country. After just one beer we head over to the restaurant where we met the rest of the board of the Danish Oracle User Group and the other two co-travellers, John King and Ludovico Caldera, for a very nice dinner. As the city was crowded due to another - slightly larger - conference all hotel rooms were either booke...

APEX 5.1 NF : Show Custom Application Icons in the APEX Builder

It just isn't fair. If you install a Packaged Application - and you should because there is a lot to learn from those apps - in your APEX Workspace they all have a cool looking icon. And your own applications, just show up with two characters in a (random?) coloured box. Why can't I have a nice looking icon for my application? In APEX 5.1 you can! Upload an image as a Static Application File . According to the help it should by 64 x 64 pixels, but I noticed it can be larger as well. It should be square though to show up nicely. Don't put it in a (sub)directory, it should be placed in the 'root' folder. Then edit the Application Definition (either via Shared Components > Application Definition Attributes or by clicking on the "Edit Application Attributes" on the Application Builder home screen. Then scroll down until you see the "Icon File Name" property. Enter the name of the uploaded file there - but don't reference #APP_...