ERWin Template Overview By: Dave Wentzel. Agenda u Overview of Templates/Macros u Template editor u Available templates u Independent column browser u.

Slides:



Advertisements
Similar presentations
MSc IT UFCE8K-15-M Data Management Prakash Chatterjee Room 2Q18
Advertisements

Keys, Referential Integrity and PHP One to Many on the Web.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Introduction to Structured Query Language (SQL)
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Introduction to Structured Query Language (SQL)
Using ERWin to model your data Supplied by Computer Associates as part of AllFusion.
Transforming Data Models into Database Designs
Database Systems Relational Model Concepts Toqir Ahmad Rana Database Management Systems 1 Lecture 17.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
Primary & Foreign Keys. PK & FK 1.Primary key is required 2.The PK must be unique 3.If the primary key from one table is related to a field in another.
Chapters 17 & 18 Physical Database Design Methodology.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Database Technical Session By: Prof. Adarsh Patel.
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
© Logicalis Group Using DB2/400 effectively. Data integrity facilities Traditional iSeries database usage Applications are responsible for data integrity.
Data Integrity An empty database is a correct database.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Administration: The Complete Guide to Practices and Procedures Chapter 13 Data Integrity.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 7 (Part a): Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Commercial RDBMSs Access and Oracle. Access DBMS Architchecture  Can be used as a standalone system on a single PC: -JET Engine -Microsoft Data Engine.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Oracle 11g: SQL Chapter 4 Constraints.
Module 4: Implementing Data Integrity
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
06 | Modifying Data in SQL Server Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Session 1 Module 1: Introduction to Data Integrity
Agenda for Class 2/20/2014 Introduce Microsoft’s SQL Server database management system. Use the lab to discuss how to CREATE, DROP and populate (INSERT)
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
Chapter 3: Relational Databases
IMS 4212: Constraints & Triggers 1 Dr. Lawrence West, Management Dept., University of Central Florida Stored Procedures in SQL Server.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Constraints Advanced Database Systems Dr. AlaaEddin Almabhouh.
SQL Basics Review Reviewing what we’ve learned so far…….
Building the Corporate Data Warehouse Pindaro Demertzoglou Lally School of Management Data Resource Management.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Getting started with Accurately Storing Data
Fundamental of Database Systems
Tables & Relationships
Managing Tables, Data Integrity, Constraints by Adrienne Watt
SQL MODELER - OPEN There are Three Ways to open the SQL Modeler
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Lecture # 13 (After 1st Exam)
Module 5: Implementing Data Integrity by Using Constraints
COS 346 Day 8.
Relational Database Design
Database Design: Relational Model
Chapter 11 Managing Databases with SQL Server 2000
CS122 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
Navigating SSMS Primer for Beginners
Presentation transcript:

ERWin Template Overview By: Dave Wentzel

Agenda u Overview of Templates/Macros u Template editor u Available templates u Independent column browser u Forward engineering process u Trouble shooting

What is a template ? u ERWin contains a macro language u Used for the creation of: –Stored Procedure Templates –Trigger Templates –Table script template (pre & post) u Based on type of template, will automatically generate SP, trigger, or script based on table/relationship information when the model is forward engineered

Why are we using templates? u Provide turn-key approach to data model creation u Reduce the number of triggers and stored procedures which need to be written u Can more easily make model changes without having to ‘re-write’ triggers and SPs

A little on the Macro Language... u ERWin contains a Template Toolbox which is used to create the templates

Types of Macros u Entity –Applied to tables in the diagram –Can be used to act as a loop - ‘For Each Entity’ –Can be used to reference qualities of an entity - ‘For Each (Attribute/Index/Key…)’ u Relationship –Applied to relationship information between entities –Can reference PK, FK, Parent/Child entities

Types of Macros Continued u Attribute –References ‘attributes’ of attributes such as length, field type, FK/PK, etc. u Constraint –References database constraint information u Miscellaneous –Arithmetic operators –Comparison operators –System Information

Stored Procedure Templates u Generates a stored procedure for WRITING / UPDATING a record in a table u Based on primary key attributes u If the key values are equal to an existing record, the record will be updated u If no matching record is found, a new record will be inserted u To be used as low level write routine called from higher level SPs.

Accessing the SP Templates u Right mouse click on a table u Select Table Editor / Stored Procedure option u Attach the appropriate template to the table u One must be attached for each table

Available Templates u Write Template u Stand Alone Table Triggers u Write Dimension Template u Write Fact Template

Write Template u Creates spWriteTableName u Assumes PK is an IDENTITY column u Assumes PK is FieldNameInst u Assumes columns: –Create Date / Create User –Modify Date / Modify User –If PK provided, updates record otherwise inserts new record

Standalone Table Triggers u Generates the insert/update triggers for standalone tables u Standalone tables may occur if created as a reference table u Generated through the SP template instead of the Trigger template because the trigger template assumed relationships

Write Dimension Template u Found in Datamart diagrams u Assumes a PK of identity u Assumes PK is FieldNameInst u Assumes no updates u If PK does not exist, will write new record

Write Fact Template u Found in Datamart diagrams u Inserts new records into fact tables

Trigger Templates u Generates Update/Delete/Insert triggers for a table and it associated tables u Helps maintain RI and date validations between related tables

Triggers and Relationships u Triggers are generated based on relationships between two entities u Double click on a relationship line –Child Delete / Insert / Update –Parent Delete / Insert / Update u Options: –Restrict - prevent –Cascade - propagate change –None - no trigger relationship

Accessing the Trigger Templates u Left mouse click on a table u Select SQL Server Trigger u Select SQL Server Trigger Template to attach Triggers

Available Trigger Templates u Approach Child Delete Restrict u Approach Child Delete Cascade u Approach Child Insert Restrict u Approach Child Update Restrict u Approach Parent Delete Cascade u Approach Parent Delete Restrict u Approach Parent Insert Restrict u Approach Parent Update Restrict

Available Trigger Templates u Approach Delete Footer u Approach Delete Header u Approach Insert Footer u Approach Insert Header u Approach Update Footer u Approach Update Header

Parent / Child Templates u On restrict, provides Raise Error message when a parent / child relationship exists u On cascade, will delete all associated tables with the same primary key u Verifies records do not overlap based on from and thru dates u Requires fields either FromDate / ThruDate or BeginDate / EndDate u Assumes domain type of ID in some models

Header / Footer Templates u Header creates the ‘Create Trigger’ code, parameters, and initial date checks against the table u Footer templates update the ModifyDate/User in the update triggers u Assume ModifyDate/ ModifyUser fields

Standard selections for RI Actions

Table Templates u Pre / post scripts generated during table creation u Used to generate print statement before table creation so implementation script is easier to read u Used for the OLAP fact tables to generate update triggers

Accessing Table Templates u Left click on table u Select Table Editor / Pre & Post Script

Independent Column Browser u Provides method of creating standard fields for use in current data model u Example: Used for standard fields applied to all tables u Domain type of ID exists which is referenced by some templates and must be assigned PK identity columns

Accessing the Independent Column Browser u Under Window select Independent Column Browser Option

Forward Engineering the Model u Triggers, stored procedures, and table scripts will be generated when you forward engineer the data model - based on the options you select u To forward engineer the model, select: Tasks \ Forward Engineer/Schema Generation

Schema Generation

Schema Options to Select u Table –Create Table –Drop Table –Pre-Script –Post-Script –Create Procedure –Drop Procedure

Options continued u Column –Validation –Default u Index –Create Index »Alternate Key »Foreign Key »Inversion Entry »CLUSTERED »Physical Storage

Options Continued u Referential Integrity –Primary Key »Alter (PK) –Foreign Key »Alter (FK) u Trigger –User Defined »RI Type Override »Relationship Override

Forward Engineer u Select PREVIEW u Cut / paste into SQL query window to run u Do not directly forward engineer into the database –Could delete items you did not anticipate –May be connected to a production server

Troubleshooting u Execute script u Review error statements u Review script code with error u Access the template to see what it is expecting u Verify correct relationships, triggers, SPs, etc. are associated with the table u Verify required fields are assigned to the table