473,569 Members | 3,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to export resultset to CSV

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

Aug 9 '07 #1
3 5428
On Aug 9, 3:38 am, bab...@gmail.co m 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..

Aug 9 '07 #2
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...@gmai l.comwrote:
On Aug 9, 3:38 am, bab...@gmail.co m 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..

Aug 9 '07 #3
Thanks everybody..

On 9 Aug, 21:37, dotyet <dot...@yahoo.c omwrote:
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...@gmai l.comwrote:
On Aug 9, 3:38 am, bab...@gmail.co m 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 -

Aug 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3638
by: RoyalScorpion | last post by:
hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after insertion and also the data, this is the code prove what i say int currentRow = resultset.getRow(); display(resultset);...
14
12830
by: atse | last post by:
Hi experts, I retrieve data from the database and display on ASP, then I export these data to a file, like Excel (the best) or text file. Is it possible? I think it is possible, but how can I do that? Thanks for any help. Atse
2
1778
by: Savas Ates | last post by:
I have a stored procedure below.. When I run it with a well parameter in query analyser 3 of select statements return me. (i named select statements 1,2,3) But in asp page when i call this procedure same as query analyser it returns me 2 select statements value? what is the problem ? CREATE PROCEDURE ST_25INDIRIM @sesid BIGINT AS
7
12800
by: Gandalf | last post by:
Hi all, I am connecting to DB2 8.1 on Solaris through JDBC type 4 drivers (driver: com.ibm.db2.jcc.DB2Driver). Problem is that when a cursored query is done, the resultset gets closed after commit (resultset.next() throws SqlException "Invalid operation: result set closed"). Is there a way to tell DB2 not to close the resultset/cursor?
4
4436
by: _link98 | last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is FORWARD_ONLY. Is it possible to have ResultSet cursors from SQL/PL procedures to scroll forward and backwards? Perhaps I am missing something. Environment: client UDB 8.1 FP9a on Win32, server UDB 8.1 FP9a on Solaris 8 (64BIT). The JDK version on the WinXP client is
7
3825
by: mattc66 via AccessMonster.com | last post by:
I need to create an EDI 850 Record Set. The EDI 850 Record set I am creating consists of 2-5 seperate tables all linked by the CustomerID and CustomerPO. Tables - tblOrder - >Link CustomerID and CustomerPO -RecordType -CustomerID -> -OrderDate
0
6152
by: David Linsin | last post by:
I created a simple test case to reproduce the problem (also check Bug #15500): import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; /** * Simple test program to reproduce bug
0
616
by: babdya | last post by:
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
1
2892
by: alpareshamwala | last post by:
hi! one and all! i have got stuck !! i am not able to export my data from jdbc resultset to excel do some work and then get back the output in excel back to java thanks alpa
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.