Database Reference
In-Depth Information
14. In Microsoft Excel, navigate to the TICKET_DETAILS tab and copy all the
data, including the column headings, in that spreadsheet to the clipboard.
15. In your browser, paste the data you copied to the clipboard into the
Data
text area, ensure that
First row contains column names
is checked, and
click
Next
.
16. Review the mappings made by APEX in the
Define Column Mapping
re-
gion. It should have mapped everything correctly. Click
Load Data
to com-
plete the data load. The summary should say that 22 records were loaded
into the
TICKET_DETAILS
table with zero errors.
You now have both of the main tables created and loaded with the legacy data. This
alone is enough to start developing an application, but you're not quite ready to begin
yet.
Creating a Lookup Table
Have a look at the definitions and data of the tables you just created. They're basically
mirror images of the spreadsheet tabs the technicians were using before. If you exam-
ine the data closely, notice that there are still some areas where the data isn't quite nor-
malized the best that it could be.
For instance, in the
TICKETS
table, notice that the
STATUS
column has only three
values—
OPEN
,
CLOSED
, and
PENDING
—which repeat over and over. The data values
in this column indicate that it's a perfect candidate for creating a lookup table. Al-
though it's tempting to go off and create the table manually with the Create Table Wiz-
ard and then manually migrate the data, APEX can create a lookup table—complete
with its own sequence, trigger, and foreign key—and modify the original table so it
points to the new lookup table, all without you writing a line of code. Here's how:
1.
Navigate to the Object Browser, and select the
TICKETS
table in the
Ob-
ject List
on the left side of the screen. You should see results similar to
those shown in
Figure 4-16
.