Database Reference
In-Depth Information
Figure 4-2. Defining the table and its columns
5.
Enter the details for the TICKETS table as indicated in the ERD from the
end of Chapter 3 and in Figure 4-2 . Then click Next .
The next page ( Figure 4-3 ) lets you choose how you would like the
primary key to be populated and which column to use as the primary key.
The four options for primary key are fairly self-explanatory, but the two in
the middle are probably the most common. You're starting from scratch
and therefore don't have any existing sequences defined in your database.
By selecting “Populate from a new sequence,” you tell APEX to create a
sequence for you and create a database trigger on the table that will popu-
late the selected primary-key column with the next value from the se-
quence, unless the field already has a value. You're given the chance to
name the sequence in this step as well. In this instance, you'll use the de-
fault name given.
Figure 4-3. Defining the table's primary key
6.
Select the Populated from a new sequence radio button. After the screen
changes, select TICKET_ID (NUMBER) for the primary key. Click Next .
7.
You're not going to create any foreign keys in this table just yet, so leave
the defaults and click Next .
The Constraints screen in Figure 4-4 allows you to add either Unique or
Check constraints to the table definition. You add a constraint by defining
the constraint in the Add Constraints region and clicking the Add button to
add it to the list. Below the Add Constraints region are two help regions.
 
 
 
Search WWH ::




Custom Search