home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / ingres / 1941 < prev    next >
Encoding:
Text File  |  1992-11-19  |  3.4 KB  |  66 lines

  1. Xref: sparky comp.databases.ingres:1941 comp.databases.sybase:363 comp.databases:7954
  2. Newsgroups: comp.databases.ingres,comp.databases.sybase,comp.databases
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!gsbacd.uchicago.edu!cs_mj
  4. From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
  5. Subject: re: Validating data imported from text files.
  6. Message-ID: <1992Nov19.134218.1@gsbacd.uchicago.edu>
  7. Lines: 54
  8. Sender: news@uchinews.uchicago.edu (News System)
  9. Organization:     
  10. Date: Thu, 19 Nov 1992 19:42:18 GMT
  11.  
  12. In <18NOV199217192059@stars.gsfc.nasa.gov>, thompson@stars.gsfc.nasa.gov
  13. (William Thompson, code 682.1, x2040) writes:
  14.  
  15. > I was just told something startling.  In an E-mail message from Myron China
  16. > <mryo@ind_maroon.gwl.com>, I was told
  17. >    problem with flat file xfers is verifying successful completions of both
  18. >    the dump and the import.  oracle products, for instance, always signal 
  19. >    a 0 return code whether or not it had a problem.  so you end up spooling
  20. >    log files and checking them for errors yourself.  we also check file
  21. >    record layouts for validity before anything goes through.
  22. > That's an astonishing statement to me!  Our current plan calls for *ALL* data
  23. > imported into the database to come from flat ASCII files generated by other
  24. > programs.  Populating the database is supposed to be an automatic process that
  25. > works unattended.  Problems are supposed to be signalled when they occur.
  26. > Is this the same with the other major SQL databases: Ingres, Sybase, Informix?
  27.  
  28. I can only speak for INGRES.  I think this reflects a bias in relational
  29. databases in general and SQL in particular towards small transactions. 
  30. In INGRES, bulk loads from flat files (using the SQL "copy table"
  31. statement) are optimized for fast operation.  This means that, in
  32. particular, all integrities on the table are ignored.  So you could end
  33. up with data in the table that violates the integrities.  I think that
  34. there are other properties of a table that are ignored by "copy", but
  35. I'm not sure which ones (possibly unique indexes, enforcement of
  36. noduplicates, or triggers and rules).
  37.  
  38. However, INGRES _is_ smart enough to detect certain kinds of errors, and
  39. has options for (1) aborting the whole operation on the first error, or
  40. after n errors; (2) continuing on errors and writing the bad input
  41. records to another file.  If you choose the abort option (the default),
  42. then I'm pretty sure that the "copy" statement returns an SQL error code
  43. in the SQLCODE if there's an error.
  44.  
  45. Ingres recommends changing the storage structure of your tables to heap
  46. (no index) before loading them with "copy table", and only _then_
  47. applying indexing, integrities, etc.
  48.  
  49. If you want the full power of the database for enforcing rigid rules on
  50. the data, then you will have to write a program to load the data one row
  51. at a time, using the SQL "insert" statement instead.  This will give you
  52. full error handling and assurance that what's in the table is what you
  53. expect.  If you use INGRES's repeated queries, or database procedures,
  54. the performance may not be bad either.  It would be interesting to do a
  55. benchmark comparison of these.
  56.  
  57. --Mark Jaeger                internet: cs_mj@gsbvax.uchicago.edu
  58. Graduate School of Business        yellnet:  (312) 702-0328
  59. University of Chicago            faxnet:   (312) 702-0233
  60. Disclaimer: My opinions are my own and not those of my employer.
  61. Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.
  62.  
  63.