home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!hayes!fgreene
- From: fgreene@hayes.com
- Newsgroups: comp.databases.oracle
- Subject: Re: Double data entry comparisons
- Message-ID: <6624.2b495664@hayes.com>
- Date: 5 Jan 93 09:35:32 EDT
- References: <1993Jan4.154617.11411@macc.wisc.edu>
- Organization: Hayes Microcomputer Products, Norcross, GA
- Lines: 53
-
- In article <1993Jan4.154617.11411@macc.wisc.edu>, dly@vms.macc.wisc.edu writes:
- > I have a database design question on double data entry comparisons.
- > If it matters, we will be using ORACLE 7.0 (we haven't got it yet),
- > SQL*FORMS 3.0, on the Sun platform.
- >
- > Debbie Yoshihara
- > Department of Biostatistics
- > DLY@MACC.WISC.EDU
-
- I have built similar applications for product testing in pharmacy
- systems. The easiest way is to build a work table, make your original
- entries in it, and then validate and transfer to the final table. In that
- way you don't have to worry about klutzing up your live data (it makes
- auditors very happy).
-
- On the input side, you need to build triggers into your entry forms
- to limit you to a maximum of two entries per key field. include an ENTRY
- field such that if no previous record exists, the value is set to 1. If a
- single previous record is found then the value is set to 2. If two previos
- record already exist then there is an error.
-
- You mentioned that there will be non-validated data, such as
- comment fields. In my experience, I found that you have the first entry
- clerk input all data, including the comments and the second clerk only the
- validation fields. Hence, record 1 will always be thetransfer record and
- record 2 the validation record.
-
- Actual validation is best accomplished using PL/SQL. Use a cursor
- to fetch the records in key-field sequence. You will need to establish a
- control variable to keep track of whether you are looking at record 1 or
- record 2 of a set. If record 1, save the validation fields to local
- variables -- if record 2 compare the validation fields to local variables.
- If the fields are identical set a transfer flag in both record 1 and record
- 2.
-
- Output all records with the transfer flag set and an entry value of
- 1 to the final table. These are the records that contain the optional
- fields. Delete all records from the work table where the transfer flag is
- set. What is left are the records that failed the validation tests.
-
- ----------------------------------------------------------------------------
- | Frank Greene | ////// ////// |
- | DELPHI SYSTEMS, Inc. | //// //// |
- | Telephone [615] 458-6032 | //// //// ////// |
- | Compuserve 74200,427 | //// //// //// |
- | 324 Ootsima Way | //// //// //// |
- | Loudon, TN 37774 | ////// ////// ////// |
- ----------------------------------------------------------------------------
- | Of course, any opinions or suggestions are strictly my own |
- ----------------------------------------------------------------------------
-
-
-
-