Database Reference
In-Depth Information
create or replace trigger "BI_TICKETS"
before insert on "TICKETS"
for each row
begin
if :NEW."TICKET_ID" is null then
select "TICKETS_SEQ".nextval into
:NEW."TICKET_ID" from sys.dual;
end if;
end;
Now that you have the
TICKETS
table defined, let's go back and create
the
TICKET_DETAILS
table. This time you'll create a foreign key to the
TICKETS
table, as a
CASCADE DELETE
. This means that if you delete a
ticket, the ticket details will automatically be deleted as well.
10.
Start the Create Table Wizard using the
Create
button.
11.
Figure 4-6.
Defining the TICKET_DETAILS table
The next set of steps is purposefully a bit more vague than the previous
ones. You should be used to using the Create Table Wizard by now, but if
you need a refresher, just look at the previous steps.