<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>&nbsp;
<div>
<div>I once wrote a copy table like script with report writer using&nbsp; the system tables as far as I remember it was very straightforward to do.</div>

<div>won&#39;t a copydb script help ?</div>

<div>&nbsp;</div>

<div>Allan</div>

<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b>&nbsp;Wednesday, March 09, 2016 at 11:39 PM<br/>
<b>From:</b>&nbsp;&quot;Chris Clark&quot; &lt;Chris.Clark@actian.com&gt;<br/>
<b>To:</b>&nbsp;&quot;Karl Schendel&quot; &lt;schendel@kbcomputer.com&gt;, &quot;pwhite peercore&quot; &lt;pwhite@peercore.com.au&gt;<br/>
<b>Cc:</b>&nbsp;&quot;Ingres and related product discussion forum&quot; &lt;info-ingres@lists.planetingres.org&gt;<br/>
<b>Subject:</b>&nbsp;Re: [Info-ingres] COPY command support</div>

<div name="quoted-content">I can confirm that the driver uses ODBC and so does not have access to libq functionality.<br/>
<br/>
You can hook up to something like PrettyTable, or a two liner using the stdlib csv module. I would avoid manually doing the formatting yourself. If you really need copy table functionality/formatting then shelling out via subprocess is worth looking at.<br/>
<br/>
As a side note, if it were me I&#39;d consider using the pyodbc (or pypyodbc) driver instead. It won&#39;t give you copy table support but you don&#39;t have to build them to get access to Ingres, unlike ingresdbi.<br/>
<br/>
Chris<br/>
<br/>
-----Original Message-----<br/>
From: info-ingres-bounces@lists.planetingres.org [mailto:info-ingres-bounces@lists.planetingres.org] On Behalf Of Karl Schendel<br/>
Sent: Tuesday, March 08, 2016 7:06 PM<br/>
To: pwhite peercore &lt;pwhite@peercore.com.au&gt;<br/>
Cc: Ingres and related product discussion forum &lt;info-ingres@lists.planetingres.org&gt;<br/>
Subject: Re: [Info-ingres] COPY command support<br/>
<br/>
I suspect that the issue is running via DBI. COPY depends on a very tight coupling between server and client, and requires a lot of client side support.<br/>
It&#39;s really only supported from LIBQ (ie, embedded SQL library), although with enough code one can make it work via the OpenAPI as well.<br/>
<br/>
I don&#39;t know what DBI uses but it&#39;s probably impractical to implement a COPY with it. The best bet is to run select retrievals and do a bit of formatting once the rows come out of dbi.<br/>
<br/>
Karl<br/>
<br/>
<br/>
&gt; On Mar 8, 2016, at 6:39 PM, pwhite peercore &lt;pwhite@peercore.com.au&gt; wrote:<br/>
&gt;<br/>
&gt; Hi Saumya,<br/>
&gt;<br/>
&gt; What operating system are you running?<br/>
&gt;<br/>
&gt; The copy statement was working fine in Ingres 2.0<br/>
&gt;<br/>
&gt; Please try running copydb from the operating system command prompt.<br/>
&gt;<br/>
&gt; copydb mydb mytable<br/>
&gt; or<br/>
&gt; copydb -c mydb mytable<br/>
&gt;<br/>
&gt; This generates two files copy.in and copy.out which you then use to<br/>
&gt; import and export data from the database.<br/>
&gt; Both copy.in and copy.out contain examples of the copy statement.<br/>
&gt;<br/>
&gt; See simple example here:<br/>
&gt; <a href="http://en.allexperts.com/q/Ingres-3317/Ingres-flat-files-unix.htm" target="_blank">http://en.allexperts.com/q/Ingres-3317/Ingres-flat-files-unix.htm</a><br/>
&gt;<br/>
&gt; Paul<br/>
&gt;<br/>
&gt;<br/>
&gt;<br/>
&gt; -----Original Message-----<br/>
&gt; From: info-ingres-bounces@lists.planetingres.org<br/>
&gt; [mailto:info-ingres-bounces@lists.planetingres.org] On Behalf Of<br/>
&gt; saumya saxena<br/>
&gt; Sent: Wednesday, 9 March 2016 12:56 AM<br/>
&gt; To: info-ingres@lists.planetingres.org<br/>
&gt; Subject: [Info-ingres] COPY command support<br/>
&gt;<br/>
&gt; Hi experts,<br/>
&gt;<br/>
&gt; I&#39;m using ingresdbi2.0 for executing queries. I have a requirement of<br/>
&gt; executing COPY command to dump the table data to flat file. But found<br/>
&gt; there is no support for it, please advice what can be done for it ?<br/>
&gt;<br/>
&gt; Thanks,<br/>
&gt; Saumya<br/>
&gt; _______________________________________________<br/>
&gt; Info-ingres mailing list<br/>
&gt; Info-ingres@lists.planetingres.org<br/>
&gt; <a href="http://lists.planetingres.org/mailman/listinfo/info-ingres" target="_blank">http://lists.planetingres.org/mailman/listinfo/info-ingres</a><br/>
&gt;<br/>
&gt; _______________________________________________<br/>
&gt; Info-ingres mailing list<br/>
&gt; Info-ingres@lists.planetingres.org<br/>
&gt; <a href="http://lists.planetingres.org/mailman/listinfo/info-ingres" target="_blank">http://lists.planetingres.org/mailman/listinfo/info-ingres</a><br/>
<br/>
_______________________________________________<br/>
Info-ingres mailing list<br/>
Info-ingres@lists.planetingres.org<br/>
<a href="http://lists.planetingres.org/mailman/listinfo/info-ingres" target="_blank">http://lists.planetingres.org/mailman/listinfo/info-ingres</a><br/>
<br/>
_______________________________________________<br/>
Info-ingres mailing list<br/>
Info-ingres@lists.planetingres.org<br/>
<a href="http://lists.planetingres.org/mailman/listinfo/info-ingres" target="_blank">http://lists.planetingres.org/mailman/listinfo/info-ingres</a></div>
</div>
</div>
</div></div></body></html>