Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

November 04, 2002

Create csv files from Oracle

After resolving the issue mentioned eariler I successfully massaged my data. I then needed to extract the data into a convenient interchange format. To create comma seperated values from Oracle in the past I have written table specific queries in SQL*Plus and hacked the resulting output file into a reasonable format.

Not this time though. I resolved to write a generic csv creator and did just that in about two minutes. Say hello to If your browser has problems with displaying the text you can download the Python code here.

The only prerequisite is that you have the cx_Oracle db API driver installed. If you wish to use DCOracle2 then simply change lines 13 and 35, replacing 'cx_Oracle' with 'DCOracle2'.

Suggestions for improvement, feedback and patches are gratefully received.

Posted by Andy Todd at November 04, 2002 04:33 PM