Received: from VL-MS-MR001.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by postgresql.org (Postfix) with ESMTP id D3EFD4758F6 for ; Wed, 3 Apr 2002 23:09:16 -0500 (EST) Received: from mo.com ([24.202.14.35]) by VL-MS-MR001.sc1.videotron.ca (Netscape Messaging Server 4.15) with ESMTP id GU0ZJI01.0AY for ; Wed, 3 Apr 2002 23:09:18 -0500 Message-ID: <3CABD1C3.8020606@mo.com> Date: Wed, 03 Apr 2002 23:08:35 -0500 From: Carlos Moreno User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Getting "copy from" to work from a C++ program Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/7 X-Sequence-Number: 2549 Hi, I'm trying to insert several records into a table in one shot (from a C++ program, that is). All my attempts to use "copy from" have failed (well, I haven't tried copying from an actual file, since I have the data in memory, and I'd like to avoid the overhead to write it to a file first). Is it possible?? I've tried things like: PgDatabase db(" ..... "); db.Exec ("copy deleteme from stdin\n1\tName1\n2\tName2"); And similar things (with a ; after stdin, with a \n. or \n\\. at the end of the string -- they all fail with an ErrorMessage() indicating a syntax error in the statement. Help?!! :-( Will it be necessary that I dump the data into a temporary file and then do copy deleteme from tmpfile.txt ?? Thanks, Carlos --