home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / oracle / 2680 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  3.1 KB

  1. Path: sparky!uunet!hayes!fgreene
  2. From: fgreene@hayes.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Double data entry comparisons
  5. Message-ID: <6624.2b495664@hayes.com>
  6. Date: 5 Jan 93 09:35:32 EDT
  7. References: <1993Jan4.154617.11411@macc.wisc.edu>
  8. Organization: Hayes Microcomputer Products, Norcross, GA
  9. Lines: 53
  10.  
  11. In article <1993Jan4.154617.11411@macc.wisc.edu>, dly@vms.macc.wisc.edu writes:
  12. > I have a database design question on double data entry comparisons.
  13. > If it matters, we will be using ORACLE 7.0 (we haven't got it yet),
  14. > SQL*FORMS 3.0, on the Sun platform.
  15. > Debbie Yoshihara
  16. > Department of Biostatistics
  17. > DLY@MACC.WISC.EDU
  18.  
  19.     I have built similar applications for product testing in pharmacy 
  20. systems.  The easiest way is to build a work table, make your original 
  21. entries in it, and then validate and transfer to the final table.  In that 
  22. way you don't have to worry about klutzing up your live data (it makes 
  23. auditors very happy).
  24.  
  25.     On the input side, you need to build triggers into your entry forms 
  26. to limit you to a maximum of two entries per key field.  include an ENTRY 
  27. field such that if no previous record exists, the value is set to 1.  If a 
  28. single previous record is found then the value is set to 2.  If two previos 
  29. record already exist then there is an error.
  30.  
  31.     You mentioned that there will be non-validated data, such as 
  32. comment fields.  In my experience, I found that you have the first entry 
  33. clerk input all data, including the comments and the second clerk only the 
  34. validation fields.  Hence, record 1 will always be thetransfer record and 
  35. record 2 the validation record.
  36.  
  37.     Actual validation is best accomplished using PL/SQL.  Use a cursor
  38. to fetch the records in key-field sequence.  You will need to establish a
  39. control variable to keep track of whether you are looking at record 1 or
  40. record 2 of a set.  If record 1, save the validation fields to local
  41. variables -- if record 2 compare the validation fields to local variables.
  42. If the fields are identical set a transfer flag in both record 1 and record 
  43. 2.
  44.  
  45.     Output all records with the transfer flag set and an entry value of 
  46. 1 to the final table.  These are the records that contain the optional 
  47. fields.  Delete all records from the work table where the transfer flag is 
  48. set.  What is left are the records that failed the validation tests.
  49.  
  50.  ----------------------------------------------------------------------------
  51.  |      Frank Greene                  |          //////  //////             |
  52.  |      DELPHI SYSTEMS, Inc.          |           ////    ////              |
  53.  |      Telephone [615] 458-6032      |          ////    ////  //////       |
  54.  |      Compuserve 74200,427          |         ////    ////    ////        |
  55.  |      324 Ootsima Way               |        ////    ////    ////         |
  56.  |      Loudon, TN 37774              |       //////  //////  //////        |
  57.  ----------------------------------------------------------------------------
  58.  |         Of course, any opinions or suggestions are strictly my own       |
  59.  ----------------------------------------------------------------------------
  60.  
  61.  
  62.     
  63.