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

  1. Newsgroups: comp.databases.ingres
  2. Path: sparky!uunet!cs.utexas.edu!swrinde!emory!sol.ctr.columbia.edu!destroyer!ncar!uchinews!gsbacd.uchicago.edu!cs_mj
  3. From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
  4. Subject: re: Validating data imported from text files.
  5. Message-ID: <1992Nov20.144010.1@gsbacd.uchicago.edu>
  6. Lines: 49
  7. Sender: news@uchinews.uchicago.edu (News System)
  8. Organization:     
  9. References: <1992Nov19.134218.1@gsbacd.uchicago.edu>
  10. Date: Fri, 20 Nov 1992 20:40:10 GMT
  11.  
  12. In article <1992Nov19.134218.1@gsbacd.uchicago.edu>, 
  13. cs_mj@gsbacd.uchicago.edu (Mark Jaeger) writes:
  14. > In <18NOV199217192059@stars.gsfc.nasa.gov>, thompson@stars.gsfc.nasa.gov
  15. > (William Thompson, code 682.1, x2040) writes:
  16. >> I was just told something startling.  In an E-mail message from Myron China
  17. >> <mryo@ind_maroon.gwl.com>, I was told
  18. >> 
  19. >>    problem with flat file xfers is verifying successful completions of both
  20. >>    the dump and the import.  oracle products, for instance, always signal 
  21. >>    a 0 return code whether or not it had a problem.  so you end up spooling
  22. >>    log files and checking them for errors yourself...
  23. >> 
  24. >> That's an astonishing statement to me!...
  25. > ...
  26. > If you want the full power of the database for enforcing rigid rules on
  27. > the data, then you will have to write a program to load the data one row
  28. > at a time, using the SQL "insert" statement instead.
  29.  
  30. Some nice person at Ingres sent me the following message:
  31.  
  32.     You also have the option of performing a copy into a temporary
  33.     table,  and then using insert as select to insert into the real
  34.     table, taking advantage of integrities, grants on a particular user
  35.     to insert (rather than the 'all to public' requirement of copy), and
  36.     so on.  It keeps everything in the database, and thus doesn't depend
  37.     on an ESQL  application.
  38.  
  39. This is a good point and might just save some programmer a lot of work. 
  40. However, it has the obvious disadvantage of having to paw over the data
  41. not once, but twice.
  42.  
  43. On the subject of "grant all to public", the INGRES SQL "copy table"
  44. statement no longer has that requirement (since 6.4, I think).  Now you
  45. only need to grant "select to user/role/group" for copying out, and
  46. "insert to user/role/group" for copying in.  See p. 7-27 of the SQL
  47. Reference Manual (6.4, Dec. 1991)
  48.  
  49. I have also read the docs closer and learned that INGRES "copy
  50. table...from" ignores table integrities and rules on the table.  The
  51. suggested approach of using "insert...select" from a temporary table
  52. would fix both of these problems.
  53.  
  54. --Mark Jaeger                internet: cs_mj@gsbvax.uchicago.edu
  55. Graduate School of Business        yellnet:  (312) 702-0328
  56. University of Chicago            faxnet:   (312) 702-0233
  57. Disclaimer: My opinions are my own and not those of my employer.
  58. Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.
  59.  
  60.