Database Reference
In-Depth Information
Examining the SQL shows the steps that will be taken to create the new
lookup table, associated sequence, and trigger; insert the data into the
table; and update the data in the originating table so that it references your
new lookup table. That's quite a lot of work saved.
7.
Click Finish to complete the wizard. You're taken back to the Object
Browser. The STATUS_LOOKUP table is highlighted and its details shown.
Use the Object Browser to examine the objects that the wizard created.
Loading and Running SQL Scripts
The SQL Scripts tool of SQL Workshop allows you to create, upload, manage, and run
SQL scripts. These scripts are similar to SQL*PLUS scripts in many ways. However, if
you use scripts written for SQL*PLUS, APEX ignores any SQL*PLUS-specific syn-
tax.
Once a script is created or loaded, it's moved into the script repository, where it re-
mains until you decide to remove it. From the script repository, you can decide to edit
or run the script. When you run a script, APEX stores the results for you to view later.
For example, you can come back to review the results for possible error messages.
You're going to load and run a script that will modify the underlying data just a bit,
and here's why.
In the real world, the spreadsheet you received from the help-desk team would have
current dates and data in it; however, the ticket dates in the spreadsheet that is down-
loaded with the .zip file accompanying this topic very likely aren't current. This
would cause you to have to search back in history for the tickets if you were searching
by date. This script will update these dates so they're recent.
Another thing you need to take into consideration is that you loaded a bunch of data
into your tables that already had IDs assigned to them. Because the IDs were loaded
with the data, you didn't use your database sequences. Therefore, your sequences are
out of synch with the data. You need to drop and re-create your sequences so the next
sequence number is greater than the largest ID used in the associated table.
You're also going to alter the Before Insert trigger that was automatically created on
the TICKETS table so that it automatically fills in the CREATED_ON column. You'll
also create a couple of database views that will be used later to retrieve data formatted
for some of the specific charts and calendars you're going to create.
Search WWH ::




Custom Search