vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi there, I need to extract huge amount of data from a DB2 dabase periodically. The extracted data needs to be exported to CSV format. I have thought of writing a Java piece of code to connect to DB2 using JDBC and then execute various queries. Is there any in-built functionality using which I can export the query resultset to CSV ? Thanks Sumukh |
| |||
| babdya@gmail.com wrote: > Hi there, > I need to extract huge amount of data from a DB2 dabase periodically. > The extracted data needs to be exported to CSV format. I have thought > of writing a Java piece of code to connect to DB2 using JDBC and then > execute various queries. > Is there any in-built functionality using which I can export the query > resultset to CSV ? > > Thanks > > Sumukh > Hi Sumukh, you can use the export command. E.g. EXPORT TO file.csv OF DEL <Select Statement> For more information (changing column/decimal delimiters) see the DB2 Information center. The tradeoff is that you don't have a header file in this csv, but there are ways to solve this, they are documented somewhere in this newsgroup. Regards, Michael |
| |||
| On Aug 9, 3:38 am, bab...@gmail.com wrote: > Hi there, > I need to extract huge amount of data from a DB2 dabase periodically. > The extracted data needs to be exported to CSV format. I have thought > of writing a Java piece of code to connect to DB2 using JDBC and then > execute various queries. > Is there any in-built functionality using which I can export the query > resultset to CSV ? > > Thanks > > Sumukh The EXPORT command will do what you want to.. |
| |||
| There is just one issue though. You are limited to only 254 characters. So, if you have a varchar of length 500, you will lose 256 characters in the export. I dont know if this limitation has been removed from V9 or not, but I still face it on our V8 FP 14. Regards, dotyet On Aug 9, 10:41 am, Arun Srinivasan <arunro...@gmail.com> wrote: > On Aug 9, 3:38 am, bab...@gmail.com wrote: > > > Hi there, > > I need to extract huge amount of data from a DB2 dabase periodically. > > The extracted data needs to be exported to CSV format. I have thought > > of writing a Java piece of code to connect to DB2 using JDBC and then > > execute various queries. > > Is there any in-built functionality using which I can export the query > > resultset to CSV ? > > > Thanks > > > Sumukh > > The EXPORT command will do what you want to.. |
| ||||
| Thanks everybody.. On 9 Aug, 21:37, dotyet <dot...@yahoo.com> wrote: > There is just one issue though. You are limited to only 254 > characters. So, if you have a varchar of length 500, you will lose 256 > characters in the export. I dont know if this limitation has been > removed from V9 or not, but I still face it on our V8 FP 14. > > Regards, > dotyet > > On Aug 9, 10:41 am, Arun Srinivasan <arunro...@gmail.com> wrote: > > > > > On Aug 9, 3:38 am, bab...@gmail.com wrote: > > > > Hi there, > > > I need to extract huge amount of data from a DB2 dabase periodically. > > > The extracted data needs to be exported to CSV format. I have thought > > > of writing a Java piece of code to connect to DB2 using JDBC and then > > > execute various queries. > > > Is there any in-built functionality using which I can export the query > > > resultset to CSV ? > > > > Thanks > > > > Sumukh > > > The EXPORT command will do what you want to..- Hide quoted text - > > - Show quoted text - |