Results 1 to 2 of 2

Thread: Import

  1. #1
    Join Date
    Apr 2004

    Unanswered: Import

    Is there a way to tell the db2 import utility to skip the last row in an input file?

    85I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08022"
    with level identifier "03030106".
    Informational tokens are "DB2 v8.1.0.89", "special_15295", "U800790_15295", and
    FixPak "9".
    Product is installed at "/opt/IBM/db2/V8.1".

  2. #2
    Join Date
    Sep 2004
    You could use standard unix tools (like "wc -l" and "head -'n'") to pipe all but the last line of that file to a named pipe, then call the "load" or "import" utility with the filename of the named pipe in the FROM clause.
    Something like:
    head -$(tail +2 FILE|wc -l) FILE > /tmp/named_pipe & \
    db2 import from /tmp/named_pipe of del insert into my_table
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting

Posting Permissions

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