<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>
<div>I once wrote a copy table like script with report writer using the system tables as far as I remember it was very straightforward to do.</div>
<div>won't a copydb script help ?</div>
<div> </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> Wednesday, March 09, 2016 at 11:39 PM<br/>
<b>From:</b> "Chris Clark" <Chris.Clark@actian.com><br/>
<b>To:</b> "Karl Schendel" <schendel@kbcomputer.com>, "pwhite peercore" <pwhite@peercore.com.au><br/>
<b>Cc:</b> "Ingres and related product discussion forum" <info-ingres@lists.planetingres.org><br/>
<b>Subject:</b> 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'd consider using the pyodbc (or pypyodbc) driver instead. It won't give you copy table support but you don'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 <pwhite@peercore.com.au><br/>
Cc: Ingres and related product discussion forum <info-ingres@lists.planetingres.org><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'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't know what DBI uses but it'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/>
> On Mar 8, 2016, at 6:39 PM, pwhite peercore <pwhite@peercore.com.au> wrote:<br/>
><br/>
> Hi Saumya,<br/>
><br/>
> What operating system are you running?<br/>
><br/>
> The copy statement was working fine in Ingres 2.0<br/>
><br/>
> Please try running copydb from the operating system command prompt.<br/>
><br/>
> copydb mydb mytable<br/>
> or<br/>
> copydb -c mydb mytable<br/>
><br/>
> This generates two files copy.in and copy.out which you then use to<br/>
> import and export data from the database.<br/>
> Both copy.in and copy.out contain examples of the copy statement.<br/>
><br/>
> See simple example here:<br/>
> <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/>
><br/>
> Paul<br/>
><br/>
><br/>
><br/>
> -----Original Message-----<br/>
> From: info-ingres-bounces@lists.planetingres.org<br/>
> [mailto:info-ingres-bounces@lists.planetingres.org] On Behalf Of<br/>
> saumya saxena<br/>
> Sent: Wednesday, 9 March 2016 12:56 AM<br/>
> To: info-ingres@lists.planetingres.org<br/>
> Subject: [Info-ingres] COPY command support<br/>
><br/>
> Hi experts,<br/>
><br/>
> I'm using ingresdbi2.0 for executing queries. I have a requirement of<br/>
> executing COPY command to dump the table data to flat file. But found<br/>
> there is no support for it, please advice what can be done for it ?<br/>
><br/>
> Thanks,<br/>
> Saumya<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><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>