Oracle Forms

Last weeks I had a project in university I had to create using Oracle Forms. It should have been simple, so I chose to create cinema ticket booking application with just 5 database tables and a few forms. University’s using Oracle 10g R2 for their databases, so I downloaded the appropriate package that includes Forms Developer, as they gave instructions. Since I’m running Windows Vista, I had to modify installer’s configuration files to allow me to launch it. All I needed was appending the version of Vista OS (that’s 6.0) to the list of supported operating systems in config. Installation then requested paging file size to be increased to ~1,5 GB. The funny thing is that it was already set to minimum 2048 MB. So I had to change the minimum paging file size exactly to the one Oracle’s installation requested 😀 The installation process completed successfully then.

Database creation went fine through the Oracle’s SQL Plus console, which is kinda tricky to use at first, because you cannot navigate through the characters you wrote, so if you’ve made a typo, you have to delete everything from the end to the typo and reqrite it again (I ended up writing SQL statements in good old Notepad and copying it to the console for execution).

Real problems began when I launched Forms Builder application. Application offers a few wizards to create Data Blocks, Layout and List of Values. Data Block is a set of items (basically controls) that are used to display and enter values based on a table, view or stored procedure. Layout Wizard helps you connect different Data Blocks into a single window and adjust their visual properties. List of Values is a special window that you can use to browse and select some value, much like a combobox, but it has a separate window and can contains any number of columns.

So far so good, I was able to generate a few forms from my database tables using the wizards. Generating the next ones did not end successfully though. Selecting one table in the Data Block wizard resulted in an error shown below:
Data Block error
Doesn’t look any helpful, right?.. And no, clicking the “Help” button was pointless, it brings up a dialog with “Contact an Oracle support representative, and proceed with caution” message written in it. After some googling, I found out the cause. The table I selected had columns of types TIMESTAMP and BOOLEAN, which for some reason are not supported by the wizard. This is just plain stupid. Why offer a wizard that doesn’t recognize such types? I bet they are used quite often in real world applications. The only solution was to create the Data Block manually, which does not save your time at all.

Next major problem I ran into occurred when I started to customize forms with Stored Procedures. I’m not quite used to Oracle’s PL/SQL dialect, so it took me a while to write things correctly. After compiling one procedure, Forms Builder IDE crashed to desktop. Like that wasn’t enough, opening the same form caused every new instance of Forms Builder to crash every time! I hit google again and find out that it’s actually a “feature”! Every time you open a form in Forms Builder, it recompiles it and if any PL/SQL errors are found, it simple crashes. Nice feature, isn’t it? Why crash, why not inform the user there was an error at xyz place?..
The solution sounds silly too: you have to open the form on a machine running Windows XP and then execute “Find and Replace PL/SQL” to replace a semicolon (“;”) with a semicolon (“;”). And no, it’s not a typo 🙂 Making such a change (can we call it a change?) causes the compiled portion of the form, that is stored at the end of the form file, to be removed and form not being compiled next time you open it. Sounds silly, but it works. I managed to open my form successfully after doing the trick.

These annoyances happened a few times to me and when you’re on schedule, it is not fun having to deal with them. Creating such a simple application using Oracle Forms took me much more time than it would if I used Visual Studio. It would also be much cleaner, since in Oracle Forms data, business logic and presentation layers are all mixed into one “thing”. Your controls use PL/SQL, a procedural language, to respond to “triggers”, like WHEN-BUTTON-PRESSED, to execute a custom action. I do not like this approach of using SQL to control the whole application.

To sum it up, the project that was supposed to be simple, wasted me a lot of time. The result was the worst thing I have ever shown to anyone 🙂 Anyways, I got a 9 from 10 maximum points, but I hope I will never ever have to work with Oracle Forms again 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s