How to export resultset to CSV

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • babdya@gmail.com

    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

  • Arun Srinivasan

    #2
    Re: How to export resultset to CSV

    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..

    Comment

    • dotyet

      #3
      Re: How to export resultset to CSV

      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..

      Comment

      • babdya@gmail.com

        #4
        Re: How to export resultset to CSV

        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 -

        Comment

        Working...