July 2006
Intermediate to advanced
560 pages
12h 57m
English
As you learned earlier in this chapter, a database transaction is a unit of work performed by one or more closely related SQL statements. The following hands-on exercise teaches you how to commit or roll back a transaction.
Enter the following series of related SQL statements, which together form a transaction that inserts a new order into the ORDERS table and two associated line items into the ITEMS table:
INSERT INTO orders
(id, c_id, orderdate, shipdate, paiddate, status)
VALUES (15, 3, TO_DATE('23-JUN-2006','DD-MON-YYYY'),
TO_DATE('23-JUN-2006','DD-MON-YYYY'), NULL, 'F');
INSERT INTO items (o_id, id, p_id, quantity) VALUES (15, 1, 4, 1); INSERT ...
Read now
Unlock full access