BC remote Oracle DBA - Call (800) 766-1884
Free Oracle Tips

Oracle Consulting Oracle Training Development

Remote DBA

 

Remote DBA Plans
Remote DBA Service

 
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Internals Magazine
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 

 

   
  Oracle Tips by Burleson

Enforcing a Cascade Update  

What do we need to enforce a cascade update? One method is to utilize data dictionary tables and views to backtrack foreign key relations and then apply updates along this path. However, this may be a lengthy process and can be cause a performance problem. A simpler method is to implement a table-based cascade update. The table would contain the information that a procedure would need to update all tables that are dependent upon a main, or master, table. Therefore, the table would have to contain the master table name, the dependent table(s), and, in case we can’t duplicate the exact column name across all of the dependent tables, the column to update. The table DDL script in Listing 4.3 meets these requirements. If required, a fourth column indicating an update order could be added, and the cursor in the UPDATE_TABLES procedure (detailed later) would have to be altered to do an ordered retrieve of the information. Listing 4.3 shows the required CREATE TABLE command.      

The table by itself would be of little use. Since the data in the table is dynamic (i.e., multiple tables and columns that would have to be addressed), we must enable our trigger to be able to dynamically reassign these values. The easiest way to do this is to create a set of procedures that utilize the DBMS_SQL Oracle-provided package to dynamically reassign our update variables. Source 4.1 shows the commented code for just such a procedure set, which consists of two procedures: UPDATE_TABLES and UPDATE_COLUMN.

See Code Depot


www.oracle-script.com

Remote DBA Service
 

Oracle Tuning Book

Free Oracle dictionary reference poster

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

North Carolina Oracle Users Group

 

 Arabian horse breeder

Seeing eye horses

 

 

Burleson is the American Team

American Flag

 

 

BC Remote Oracle Support
P.O. Box 511 • Kittrell, NC, 27544

Remote DBA

Remote DBA Services

 

Copyright © 1996 -  2011 by Burleson Enterprises. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.