Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekgen!tekcae!moiram From: moiram@tekcae.CAX.TEK.COM (Moira Mallison) Newsgroups: comp.databases Subject: Re: Need help with INGRES SQL copy to/from file Message-ID: <6476@tekgen.BV.TEK.COM> Date: 29 Aug 90 19:56:28 GMT References: <11104@spool.cs.wisc.edu> <1990Aug28.211814.7355@portia.Stanford.EDU> Sender: news@tekgen.BV.TEK.COM Reply-To: moiram@tekcae.CAX.TEK.COM (Moira Mallison) Organization: Tektronix, Inc., Beaverton, OR. Lines: 18 In article <11104@spool.cs.wisc.edu> beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) writes: >> >> Iam trying to transfer the contents of one table to another >> using "copy from" and "copy into". >> For copying tables in the same database, I agree that the SQL select statement is the better answer. If you need to copy the data in and out of a file (to port to another database, for example), I usually start with the copydb command. You can constrain it to a single table with the -t flag, and to ascii output with the -c flag. The output of the copydb command will be a copy.in and copy.out scripts in the query language. You can edit these scripts if necessary, but they make a convenient starting place for the copy statement. Moira Mallison CAx Data Management Tektronix, Inc