Previous Next

Thread: Export To DB2

Last post 07-28-2008 9:18 AM by yellowdog.dave. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 07-24-2008, 5:30 AM

    • ajronald
    • Not Ranked
    • Joined on 07-24-2008, 9:28 AM
    • Posts 1

    Export To DB2

    How can I export the output to DB2?

    Tags:
  • 07-24-2008, 7:11 AM In reply to

    Re: Export To DB2

    It may not be what you really want, but we export to a CSV (or comma delimited) and import from DB2.  We do that because we don't allow direct access to the DB2 system from other apps, but it works fine.  Of course, we do the import from RPG, which alos may not be what you're looking for.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 07-28-2008, 9:18 AM In reply to

    • yellowdog.dave
    • Top 50 Contributor
    • Joined on 07-18-2008, 3:17 AM
    • Johannesburg, South Africa
    • Posts 83

    Re: Export To DB2

    Hi There, 

     I don't have a DB2 installation to play with, but logparser will work with any ODBC compliant database, the last time I looked (years back), DB2 was definitely in this category and I used it actively as an OBDC datasource. So, if you do have an ODBC driver for DB2 on your machine and setup an ODBC DB2 datasource, you should be able to simply specify the output format as -o:SQL and give it your connection details.Look in the logparser.chm under the SQL output format for additional parameters and syntax as well as examples.

    Here is an example of one of my queries that pumps data from a McAfee access log straight into an M$ Access database;

    logparser file:accessprotectionlogdb.sql -i:tsv -headerrow:off -q -o:SQL -oConnString:"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\projects\logparser\mcafee\fdaanalysis.mdb" -cleartable:on

    Although your connection string syntax would need to be somewhat different and along these lines;

    driver={IBM DB2 ODBC DRIVER};Database=demodb;hostname=myservername;port=myPortNum;protocol=TCPIP; uid=myusername; pwd=mypasswd

    With this you should achieve the result you are seeking. 

    Good luck. 

    Cheers, Dave 

    Yes, dear
Page 1 of 1 (3 items)
Page view counter