Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

Dont they all the related code and logic one place

11 END BEFORE STATEMENT;
12
13 BEFORE EACH ROW IS
14 BEGIN
15 DBMS_OUTPUT.PUT_LINE('Compound:BEFORE R:' || v_global_var); 16 v_global_var := v_global_var + 1;
17 END BEFORE EACH ROW;
18
19 AFTER EACH ROW IS
20 BEGIN
21 DBMS_OUTPUT.PUT_LINE('Compound:AFTER R:' || v_global_var); 22 v_global_var := v_global_var + 1;
23 END AFTER EACH ROW;
24
25 AFTER STATEMENT IS
26 BEGIN
27 DBMS_OUTPUT.PUT_LINE('Compound:AFTER S:' || v_global_var); 28 v_global_var := v_global_var + 1;
29 END AFTER STATEMENT;
30
31 END;

Just like a package

END;

The remaining compound trigger syntax is very similar to that of standalone triggers, but a bit more rigid:
BEFORE STATEMENT
The code in this section will fire before a DML statement executes, just like a stand‐ alone BEFORE statement trigger does.

DML Triggers | 707

Not just like a package

So compound triggers look like packages, but do they behave in the same way? The short answer is no—they behave better! Consider this example:

SQL> ALTER TABLE incremented_values
2 add constraint a_pk
3 primary key ( value_inserted );

Now to insert one record:

708 |
How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELIA17B3A1
img
Uploaded by :
53LqwYNd
Page 1 Preview
dont they all the related code and logic one place
Sell Your Old Documents & Earn Wallet Balance