Since the procedure is a standard LE-conforming program, processing logic can be incorporated in the procedure to enforce a wide variety of business rules. In the previous example, the procedure validated that the customer had appropriate credit before allowing the order to be placed. This is a simple example of business rule enforcement. More complex rules or even complex data calculations can be included in the procedure code to insure that functions such as "Calculation of product cost" or "Standard deviation" are applied consistently within an environment.
When combined with SQL triggers, you can use procedures to enforce business rules "triggered" by a database event, such as the addition of a row to a table or the update of a column within a selected table.
For example: Whenever a new customer is added to the system, the addition triggers the procedure ORDER_CREDIT_REPORT and also triggers the procedure VALIDATE_TEMP_CREDIT_LIMIT. This allows your business to make sure that credit reports are ordered on a timely basis and that a temporary credit limit is established.
|
Copyright © 2014 CA.
All rights reserved.
|
|