1 Inside Module 2 Working with Databases Page n Choosing input from databases2 n Reading an entire dataset serially6 n Determining fields in a dataset8.

Slides:



Advertisements
Similar presentations
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Advertisements

Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
1 PowerHouse and Suprtool Page n Why use Suprtool?2 n Combining Suprtool and QUIZ 4 n Linking multiple files8 n Creating complex subfiles14 n Importing.
1 Working with Suprlink Page n Accessing Suprlink4 n A sample scenario6 n Self-describing files15 n Linking files19 n Adding information32 n Suprlink requirements41.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
1 Inside Module 8 Working with Speed Demon Page n What is Speed Demon?2 n Speed Demon versus Suprtool3 n Speed Demon intrinsics6 n SPDEDBSCAN7 n SPDEDBINIT8.
Files  File organisation and usage A record is a group of logically related fields A file is a group of logically related records Files are used to store.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
BTrees & Bitmap Indexes
Introduction to Structured Query Language (SQL)
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
1 Inside Module 5 Working with Files Page n Copying files 2 n Working with ordinary disc files3 n Defining fields 4 n New or existing files7 n Writing.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Guide To UNIX Using Linux Third Edition
1.1 CAS CS 460/660 Introduction to Database Systems File Organization Slides from UC Berkeley.
Introduction to Structured Query Language (SQL)
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
SQL Query Extras MIS 433. Rerunning the last Query n Type the forward slash “/” to rerun the last query that was entered.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Introduction to Database Systems
1.A file is organized logically as a sequence of records. 2. These records are mapped onto disk blocks. 3. Files are provided as a basic construct in operating.
Advanced File Processing
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
1 HowMessy How Messy is Your Database Page n How messy is your database? 2 n Hashing algorithm5 n Interpreting master dataset lines12 n Master dataset.
1 Dbedit Editing TurboIMAGE Datasets Page n How can Dbedit help me with my work?3 n Accessing Dbedit 4 n Finding entries with a known key 6 n What if I.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall1 Exploring Microsoft Office Access Committed to Shaping the Next Generation.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 Inside Module 9 Latest Features in Suprtool n Variable Substitution n $Counter n $Clean and $FindClean n $Total and $Subtotal n $SPLIT n $EDIT n $NUMBER.
Inside Module 7 Exporting Data to the World Page n Exporting data to other applications2 n STExport converts the data4 n Running STExport5 n Dates and.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
1 Inside Module 4 Selecting Records with Suprtool Page n Using the If command 2 n Comparing fields4 n Selecting by pattern-matching 7 n Let’s do a crossword.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Key Applications Module Lesson 21 — Access Essentials
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Indexed and Relative File Processing
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan Introduction to Concurrency Control Different types.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 3 1 Integrating Microsoft Office XP Tutorial 3 – Integrating Word, Excel, Access, and PowerPoint.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Use of ICT in Data Management AS Applied ICT. Back to Contents Back to Contents.
Microsoft Access Database Creation and Management.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Excel part 5 Working with Excel Tables, PivotTables, and PivotCharts.
Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
Aggregator Stage : Definition : Aggregator classifies data rows from a single input link into groups and calculates totals or other aggregate functions.
1 Inside Module 3 Working with Eloquence Page n Commands to access Eloquence databases2 n Opening and closing a database3 n Eloquence and Base Command4.
Module 11: File Structure
Inside Module 10 Editing TurboIMAGE Datasets Page
CIS16 Application Programming with Visual Basic
Databases Lesson 2.
Exercise Open the Store database and copy the m-customer dataset into a file called Custfile Then look at the contents of Custfile >base store >get m-customer.
Chapter Four UNIX File Processing.
Inside Module 3 Working with Eloquence Page
Inside Module 2 Working with Databases Page
Inside Module 6 Working with Suprlink Page Accessing Suprlink 4
Inside Module 8 Extracting Data Page Using the Extract command 2
Presentation transcript:

1 Inside Module 2 Working with Databases Page n Choosing input from databases2 n Reading an entire dataset serially6 n Determining fields in a dataset8 n Reading specific data chains10 n Choosing Get versus Chain11 n Listing records13 n Changing Output Field Structure14 n Creating Basic Reports16 n Changing data in datasets22

2 Accessing data files n These Suprtool commands access TurboIMAGE and Eloquence datasets: BASEGET CHAINFORM PUTDELETE UPDATE

3 Opening and closing a database (Image) n You can use the BASE command to open a database >base store,5,READER n The BASE command without parameters closes a database n A database remains open until a BASE, RESET BASE or RESET ALL command is executed n Eloquence Base command is slightly different; see module 3

4 How to find datasets in a database n Use the FORM SETS command to display datasets >base store.demo Database password[;]? >form sets Database:STORE.DEMO.APPDEV TPI: SUPERDEX(15015d) SetItemCapa-EntryLoadEntry Sets:NumTypeCountcityCountFactorLengthB/F M-CUSTOMER1M %557 M-PRODUCT2M %2412 M-SUPPLIER3M %498 D-INVENTORY4D %1522 D-SALES5D %1914

5 More about the Form command n The FORM command without parameters first defaults to the current input dataset. If no input has been specified, then it defaults to FORM SETS. n All output is written to the Formout file, which can be redirected to a line printer or a disc file. Currently the Formout file is not available on HP-UX.

6 Datasets as input sources n The GET command reads a dataset in one of several ways n It can read the entire dataset serially n It can read a subset of dataset records serially n It can read records at a specified interval (e.g., every 5th record). This kind of sampling is useful for test purposes. n A database must be open before you can use the GET command

7 Warnings using Get n Suprtool checks the dataset entry count before and after processing, and warns you if it has changed. n Suprtool permits concurrent changes, but warns you when this happens. If you need exclusive access, open the database in mode-4. n If you repeatedly receive warnings of new entries, use the SET EOFREAD ON command to read to end-of-file. (Must be specified before the GET command!)

8 Determining fields in a dataset n Use FORM setname to display the fields in a dataset >form m-customer M-CUSTOMERMASTERSET 1 Entry:Offset CITYX121 CREDIT-RATINGJ213 CUST-ACCOUNTZ817 > CUST-STATUSX225 NAME-FIRSTX1027 NAME-LASTX1637 STATE-CODEX253 STREET-ADDRESS2X2555 ZIP-CODEX6105 Capacity:211 (7) Entries:20 Bytes:110

9 Defining New Fields Create new field definitions: > define D-STATUS,25,1,CHAR ABSOLUTE definition: define field,byteposition,length[,type] e.g. > define ord-total,20,4,integer RELATIVE definition: define field,fieldname[(subscript)][[offset]],length[,type] e.g. > define branch-no,cust-code[1],2 Relative defines are associated with a record item, so will stay correct if the field sequence changes.

10 Reading specific data chains n If you know the key value(s), use the CHAIN command to search a dataset and select records with the specified key >chain d-sales,customer = “123456” >chain dtrans,partnum = “A123”,“B654”,“G999” >chain d-sales,customer = slist {use a table} n Even when you know the key values, the GET command may select the same records faster than CHAIN can >get d-sales; if $lookup(slist, customer)

11 Get versus Chain command GET Serial access Any dataset All records Physical order MR NOBUF reads Selection by any data fields CHAIN Keyed access Only keyed datasets Only records with key values Forward chain pointers DBFIND and DBGET mode-5 and -7 Selection by key field

12 Exercise 1 Get versus Chain: quick, choose one! n Your task is to retrieve records from the infamous ord-line detail dataset which contains 2.3 million records of 308 bytes each. The key values to be selected are in a file called Ordfile. These 162,000 ord-num field values will select 261,000 records from the dataset. n Your mission, Jim, should you decide to accept it, will be to access the records as quickly as possible, using either the GET command or the CHAIN command. The final results must be sorted in ord-num sequence. n As always, should you fail, the Secretary will disavow all knowledge of your actions.

13 Listing data from datasets n Use the LIST command without parameters to list records whose format is known >get m-customer >list >xeq >GET M-CUSTOMER (1) >OUT $NULL (0) CITY = Edmonton CREDIT-RATING = CUST-ACCT = CUST-STATUS = 30 NAME-FIRST = Terry NAME-LAST = Coyle STATE-CODE = AL

14 Changing Field Structure of Output n By default all fields in the input record are copied to the output record. n The EXTRACT command overrides this default. extract field [(subscript)][=value][,....] extract field1\field2 n Can have multiple EXTRACT commands n Up to 255 extracted fields n Can specify fieldnames, constants, strings n Output record will be assembled with fields in the same sequence as the EXTRACT commands.

15 Extract example..... >get m-customer >extract name-first, name-last >extract " City: " >extract city >output * >xeq Wayne Humphreys City: Vancouver Elizabeth Welton City: Coquitlam William Kirk City: Richmond Jack Morrison City: Calgary James Young City: Edmonton Percy Ferguson City: Coquitlam Walley Nisbet City: Surrey

16 A quick way to produce basic reports n Use the LIST STANDARD command to produce a report with a predefined format Feb 03, 1996 Base STORE.DEMO Set M-CUSTOMER Page 1 CUST-ACCO CITY NAME-FIRST NAME-LAST Edmonton Arthur Rogers Edmonton Terry Coyle Edmonton James Young Edmonton Tara Bamford IN=4, OUT=4. CPU-SEC=1. WALL-SEC=1.

17 Suprtool lets you customize reports You can modify reports to improve their appearance or functionality by doing the following: n changing the report title n changing heading names n changing the sort key to make the report contents more meaningful

18 Customizing a report title and column headings n It is easy to change your report title or column headings >get m-customer >if city = "Edmonton" >sort name-last >list standard,title "Customers in Edmonton",& >>heading "Customer Name ",& >>"City ",& >>"Account" >ext name-last,name-first,city,cust-account >xeq

19 MPE/iX third-party indexing n Requires Omnidex or Superdex indexing software or HP B- tree support (not currently supported in Suprtool/UX) n CHAIN command can access third-party or IMAGE indexes >chain m-customer,name-last = n FORM command marks IMAGE fields with third-party indexing as " >", and B-trees as " >" n VERIFY BASE command displays name and version of indexing software

20 Form command shows third-party indexes >form m-customer M-CUSTOMER Master Set#1 Entry: Offset CITYX12 1 > CREDIT-RATINGJ2 13 CUST-ACCOUNTZ8 17 > > CUST-STATUSX2 25 NAME-FIRSTX10 27 > NAME-LASTX16 37 > STATE-CODEX2 53 > STREET-ADDRESS2X25 55 POSTAL-CODEX6105 Capacity: 211 Entries:20 Entry Length:55 Blocking:7

21 Exercise 2 Create a listing of the Alberta customers Create the following report from the STORE database: Mar 20, :32 Alberta Customers Page 1 Account# Name City Rogers Edmonton Coyle Edmonton Frahm Calgary Tiernan Calgary Young Edmonton Bamford Edmonton Morrison Calgary Johnston Calgary

22 Changing data in datasets n The Put, Delete and Update commands make changes to the contents of a dataset n You must open the database in mode 1, 2, 3, or 4 You can disable the Put, Delete, and Update functions via the Set Limits ReadOnly command >set limits readonly on

23 Moving data into datasets n We recommend this set of commands to perform a major load of a dataset from a file >input loadfile >set dumponerror on {default} >set defer on >set ignore on >put m-cust,store.pub,3 >xeq n Input file record structure must match the destination dataset structure exactly!

24 What if the data doesn’t match exactly? n Use EXTRACT commands to construct the output record Use DEFINE and EXTRACT to change storage formats: > define amount,1,8,display {...in input file} > define new-amount,1,4,integer {new field} > extract new-amount = amount n Field will have attributes as defined, and value from input record, so the output record will contain the 4-byte integer value of the 8- byte display field in the input record.

25 Deleting selected records from the input dataset n Open the database in mode-1, -3, or -4 n Access the dataset using GET or CHAIN n Select records to be deleted with IF command n Delete the selected records using DELETE n Optional step: copy the deleted records somewhere else (e.g., OUTPUT file, LIST file, PUT to another dataset) >get d-sales >item purch-date,date,yymmdd >if purch-date delete >output oldsales.data,append >xeq

26 Using two passes guarantees safety >get d-sales >item purch-date,date,yymmdd >if purch-date output oldsales.data,append >xeq >get d-sales >if purch-date delete >output $null >xeq

27 Update selected records with new values n Open the database in mode-1, -2, -3, or -4 n Access the dataset using GET or CHAIN n Select records to be updated using IF n Enable updating using UPDATE command; use CIUPDATE parameter to update critical fields n Specify fields and new values using EXTRACT commands >get d-sales >item purch-date,date,yymmdd >if purch-date update >extract purch-status = “OLD” >xeq

28 Assigning Calculated Values >get d-sales >update >extract sales-total = & (product-price * sales-qty) + sales-tax >xeq Update all records from the D-SALES dataset [no]: yes Warning: Using DBGET for the input records IN=8, OUT=8. CPU-Sec=1. Wall-Sec=1.

29 Set Lock to control concurrent dataset access n SET LOCK 1 n Lock the dataset and unlock it again around every DELETE, PUT, and UPDATE n Least contention with other processes, but slowest option for Suprtool n SET LOCK 0 n Lock the dataset at the beginning of the task and unlock it only at the end n Best performance for Suprtool, but locks out other processes for duration of Suprtool run n SET LOCK n n Lock dataset on n DELETE, PUT, or UPDATE transactions, then unlock n Compromise between SET LOCK 0 and SET LOCK 1

30 Summary n Display datasets n Field names and formats n Data chains n List datasets n Reports (e.g., standard, customized) n Third-party indexing n Adding, deleting, and modifying records n Changing data formats n Locking options