Creating a Master-Detail Form

Slides:



Advertisements
Similar presentations
Information Systems Technology Ross Malaga B Copyright © 2005 Prentice Hall, Inc. B-1 WORKING WITH DATABASES.
Advertisements

Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Enhanced Guide to Oracle 10g
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Advanced Forms Builder Topics Chapter 10.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
7 Copyright © 2004, Oracle. All rights reserved. Working with Text Items.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
Chapter 5B-C: Introduction to Forms Builder: Tiggers, LOV.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Eyad Alshareef 1 Creating Custom Forms Part A. 2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are.
Introduction To Form Builder
Introduction To Form Builder
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
Chapter 3 Maintaining a Database
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
Copyright Ó Oracle Corporation, All rights reserved. 55 Working with Data Blocks and Frames.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Course ILT Access basics Unit objectives Define database and database-related terminology, and plan a database Start Access and open, create, view, and.
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Eyad Alshareef 1 Introduction To Form Builder Part B.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
2 Copyright © 2008, Oracle. All rights reserved. Building the Physical Layer of a Repository.
Chapter 7: Creating Custom Forms. Data Block and Custom Forms Data block form Based on data blocks that are associated with specific database tables Reflect.
CHAPTER 7 LESSON B Creating Database Reports. Lesson B Objectives  Describe the components of a report  Modify report components  Modify the format.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Access Tutorial 2 Building a Database and Defining Table Relationships
Eyad Alshareef, Edited by: Mostafa Ali
Working with Data Blocks and Frames
Working in the Forms Developer Environment
Creating a Basic Form Module
Developer 2000 CSE 4504/6504 Lab.
Creating LOVs and Editors
SQL MODELER - OPEN There are Three Ways to open the SQL Modeler
Introduction to Triggers
Microsoft Access 2003 Illustrated Complete
Access Tutorial 4 Creating Forms and Reports
Lesson Four: Building Custom Patient Lists
CIS16 Application Programming with Visual Basic
Chapter 6: Creating Custom Forms
Lesson Four: Building Custom Patient Lists
Creating Database Reports
Relational Queries (query 12) Display vendor contact info (contact person and phone number) for inventory products (relationship query) Query: Inventory.
Producing Triggers Schedule: Timing Topic 40 minutes Lecture
Introduction to Database Programs
Creating Noninput Items
Chapter 1 Databases and Database Objects: An Introduction
Introduction To Form Builder
Introduction to Database Programs
Creating Additional Input Items
Creating reports manually (pp. 374-)
Reports Report builder meets the challenge by making it easy to design, publish, and distribute professional, production-quality reports in a variety of.
Presentation transcript:

Creating a Master-Detail Form

Objectives After completing this lesson, you should be able to do the following: Create data blocks with relationships Modify a data block Modify the layout of a data block Run a master-detail form

Form Block Relationships Master Master Master Detail Detail  Master  Detail Detail Detail

Creating Data Blocks with Relationships A form module can contain one or more data blocks. Each data block can stand alone or be related to another data block. Master-Detail Relationship A master-detail relationship is an association between two data blocks that reflects a primary-foreign key relationship between the database tables on which the two data blocks are based. The master data block is based on the table with the primary key, and the detail data block is based on the table with the foreign key. A master-detail relationship equates to the one-to-many relationship in the entity relationship diagram. A Detail Block Can Be a Master You can create block relationships in which the detail of one master-detail link is the master for another link.

Form Block Relationships Orders Customers Customers Items Orders Orders Account Rep Items

Data Block Wizard: Master-Detail Page

Creating a Master-Detail Form Module with the Data Block Wizard 1. Create the master block as described earlier in this lesson in the topic Creating a New Data Block. 2. Invoke the Data Block Wizard in the Object Navigator. 3. Follow the same steps as before to create a new data block in the Data Block Wizard until you come to the Master-Detail page. On this page, select the “Auto-join data blocks” check box and click Create Relationship. Note: If the “Auto-join data blocks” check box is clear, the Data Block dialog is displayed with a list of all data blocks in the form without any foreign key constraint names.

4. Select a master data block in the Data Block dialog and click OK 4. Select a master data block in the Data Block dialog and click OK. The wizard automatically creates the join condition between the detail and master data blocks in the Join Condition field and displays the name of the master data block in the Master Data Blocks field. Note: If the “Auto-join data blocks” check box is clear, the wizard does not automatically create the join condition between the detail and master data blocks. You must use the Detail Item and Master Item pop-up lists to create a join condition manually. 5. Click Next; then complete the Data Block Wizard steps. Go through the Layout Wizard steps as described earlier in the previous lesson to finish creating and laying out the detail data block. Note: The master data block must exist in the form module before you create the detail block. You can also create a relation by invoking the Data Block Wizard in reentrant mode.

Relation Object New relation object created in Object Navigator under master data block node Default name assigned: MasterDataBlock_ DetailDataBlock Triggers and program units generated automatically

Creating a Relation Manually

Creating a Relation Manually If a relation is not established when default blocks are created, you can create your own. To explicitly create a relation, perform the following steps: 1. Select the Relations node under the master block entry in the Object Navigator. 2. Click the Create icon. The New Relation window is displayed. 3. Specify the name of the detail block. 4. Choose your master delete property. 5. Choose your coordination property. 6. Specify the join condition. 7. Click OK. The new relation, new triggers, and new program units are highlighted in the Object Navigator. Like implicitly created relations, the relation is given the default name of MasterDataBlock_DetailDataBlock, for example CUSTOMERS_ORDERS. The same PL/SQL program units and triggers are created automatically when you explicitly create a relation as when the relation is created implicitly.

Join Condition The join condition creates primary-foreign key link between blocks Define a join condition using: Block and item names (not table and column names) Do not precede names with colon SQL equijoin syntax

Deletion Properties = Deleted Isolated: Only master is deleted Cascading: Master and all details are deleted Non-isolated: If no detail record, master is deleted Master-Detail Records Non-isolated: Master is not deleted if there are any detail records

Modifying a Relation

Coordination Properties Default Deferred with auto query Deferred without auto query

Running a Master-Detail Form Module Automatic block linking for: Querying Inserting Default deletion rules: Cannot delete master record if detail records exist

Running a Master-Detail Form Module When you run your master-detail form module you will find that: Querying the master data block immediately retrieves corresponding detail records. Deleting a master record is prevented if detail records exist. Note: You can change the above behavior by modifying the relation object properties. Inserting a detail record automatically associates it with the currently displayed master.

Modifying the Structure of a Data Block Reentrant Data Block Wizard: 1. Select frame or object in Layout Editor, or data block or frame in Object Navigator 2. Select Tools > Data Block Wizard OR Right-click and select Data Block Wizard OR Click Data Block Wizard Object Navigator: Create or delete items Change item properties Block Property Palette: Change property values

Modifying the Layout of a Data Block Reentrant Layout Wizard: Select frame in Object Navigator or Layout Editor Select Tools > Layout Wizard OR Right-click and select Layout Wizard OR Click Layout Wizard Layout Editor: Select Tools > Layout Editor Make changes manually Frame Property Palette: Change property values