Exforsys

Home arrow Reviews arrow Oracle Forms

Oracle Forms - The target database

Author: Packt Publishing     Published on: 18th Dec 2009

In order to convert your Forms applications to APEX, we also need the database model on our target area. Using Oracle's SQL Developer, we will be able to do both an export and an import on the database of the database objects we need in our application. In Chapter 1, we talked about the objects we needed in the application we are converting. The import is also possible in APEX using the SQL Workshop that is a part of APEX.

Ads

First, we will create the .sql file, which contains the database objects we need in the application. In SQL Developer we select the objects, in our case the tables, from S_CUSTOMER to S_WAREHOUSE. When we have selected all the objects, we right-click and select Export DLL and then click on Save to File, as shown in the following screenshot:

To save the file that contains the code to create the selected database objects, we select the directory where we want to save it, give it an appropriate name, and then click on the Select button. After this, the DLL script will be created and saved in the directory we have chosen.

When we get the DLL script of our database objects, we will implement it on our target database. This can be done by using both Oracle SQL Developer and APEX.

First, we will do it in SQL Developer because we will be able to connect this IDE to any database we are connected to, and this works pretty easy with the appropriate user credentials.

We have to open the file we just created. Click on File | Open (or use the keyboard shortcut Ctrl+O). This opens a dialog box in which we can select the file, as shown in the following screenshot:

The file will open in a separate worksheet in SQL Developer. Now we can see the statements that create the database objects for which we created the DLL file. At this point, we want to run the script on the target database schema. In the following screenshot, we see the script in SQL Developer.

By pressing F5 on our keyboard, or by going to Run in the menu and clicking on Run exportsource_dll.sql, we will run this script:

Before the actual run of the script, we need to select a connection on which the script must run. In this example, we will run the script on the OMB database schema that I have saved in my SQL Developer preferences. To learn more about the possibilities SQL Developer offers, it would be smart to read the SQL Developer user guide. After selecting the correct connection, we click on OK and the script will run on the selected database schema using the username and password settings we saved. Look at the next screenshot:

It's also possible to run the script in APEX. This might come in handy if we don't have a connection saved in our SQL Developer settings, or we just don't have the database connection on our computer.

In APEX, we first go to the place where we can control our database objects, which is the SQL Workshop. In the SQL Workshop, we see a section called SQL Scripts. In this section of APEX, we can upload, create, save, edit, and run our .sql scripts.

In the SQL Scripts section of SQL Workshop, we have the possibility to upload our script. Click on the Upload button shown at the righthand side in the following screenshot. When we have done this, we browse to the file we created in SQL Developer and give it an appropriate name. In this example, we call it exportsource. Now we can upload the file. Click on the Upload button to upload the file and we are redirected to the SQL Scripts section of APEX.

Now, we want to run the script. Click on the script we just created in the SQL Scripts section. In this example, we click on the icon that is named exportsource. This will take us to the page shown in the following screenshot:

On the righthand side of this screen, there is a button called Run. Click on this and the script will run on the same database schema we are connected to as the APEX user.

Ads

We can repeat all the steps we took to implement the tables on a target database in order to implement other database objects such as views, procedures, packages, and more.



 
This tutorial is part of a Oracle Forms tutorial series. Read it from the beginning and learn yourself.

Oracle Forms

 

Comments