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