Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    191

    Unanswered: Wanted: No (!) chardel in delimited file load

    Hi DB2 Gurus,

    as far as I can see, there is no way to tell the load utitlity to disregard chardel, is there?

    What I want is to load a delimited file like this:
    1,"To have or not to have" is the question here
    2,"To have or not to have is the question here"
    3,To have or "not" to have is the question here

    Doing a delimited file load under DB2 UDB 7.2 FP 10 will truncate the first record and give a warning, and strip off the quotation marks for records 1 and 2. Record 3 will be loaded unchanged.

    I want to keep DB2 from meddling with my strings. Is there any way to achieve this apart from setting chardel to some probably never used character?

    Johann

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Can you post the command you are trying to execute?

    Grofaty

  3. #3
    Join Date
    Apr 2003
    Posts
    191
    Hi,

    here you go:

    ----

    #!/usr/bin/ksh

    db=sample
    loadfile=load-test-fp10
    target=test

    set -o xtrace

    db2 connect to $db
    db2 drop table $target
    db2 "create table $target(col1 int not null primary key, col2 varchar(10))"
    echo '1 ; My Name' > $loadfile
    echo '2 ; My "Name"' >> $loadfile
    echo '3 ;"My Name"' >> $loadfile
    echo '4 ;"My" Name' >> $loadfile
    echo '5 ;""My Name""' >> $loadfile

    db2 load from $loadfile of del modified by coldel\; savecount 1 warningcount 10 messages $loadfile.msg replace into $target nonrecoverable

    db2 "select * from test order by col1"

    echo This should have been:
    cat $loadfile

    ----

    Johann

    Originally posted by grofaty
    Hi,

    Can you post the command you are trying to execute?

    Grofaty

Posting Permissions

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