Results 1 to 3 of 3

Thread: Loading Data

  1. #1
    Join Date
    May 2005
    Posts
    25

    Unanswered: Loading Data

    Can someone tell me how to load data from excel sheet to db2 table? Is there any way if I use , (comma) as delimiter to load only particular fields into the table rather than all fields.


    Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    how about, looking in the doc at
    IMPORT
    or at the same place, look for load command and format parameter
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by shahnazurs
    Can someone tell me how to load data from excel sheet to db2 table? Is there any way if I use , (comma) as delimiter to load only particular fields into the table rather than all fields.
    The answer depends on the version and platform where you run DB2.
    For DB2 v8 and v9 on z/OS, use the following to load a CSV file with three columns (of types CHAR, DATE, and INTEGER) into a table with column names col1, col2 and col3 (with possibly more than these three columns):
    Code:
    LOAD DATA FORMAT delimited INTO TABLE mytablename
    (col1 CHAR, col2 DATE EXTERNAL, col3 INT EXTERNAL)
    Make sure that the non-numerical CSV fields in the file (in my example: columns 1 and 2) are quoted with double quotes.
    If you want to skip some fields, you cannot use CSV but you have to use fixed-position fields instead. In that case, just specify the column names you need (and their starting position on each line in the file) between the parentheses.
    Last edited by Peter.Vanroose; 09-29-09 at 18:32.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •