Results 1 to 6 of 6

Thread: Laod utility

  1. #1
    Join Date
    Sep 2003
    Posts
    14

    Unanswered: Laod utility

    Hi,
    I am using the load utility to load data from the files.The load inserts the data in the sequence in which data is present for most files.For some files the load utility does not insert the data in the sequence it should insert.The last line gets inserted in the middle.Is there a way by which i could specify the load utility to load the data in the sequence in which it is present in the files?How do i go about this..

    With Regards,
    Deepak B G

  2. #2
    Join Date
    Jul 2003
    Location
    Austin, TX, USA
    Posts
    278

    Delimilter

    Hi,

    I guess this is happening because of the confusion of the load utility with regards to the delimiter.

    Probably the load utility is getting the delimiter at an unexpected place and hence it is treating that as a end of row and causing the concern.

    However there is no way I think in which you can tell the load utility to load which record and which not.

    I hope I have understood clearly.
    HTH

    Nitin

    Ask the experienced rather than the learned

  3. #3
    Join Date
    Sep 2003
    Posts
    14

    Re: Delimilter

    Originally posted by nitingm
    Hi,

    I guess this is happening because of the confusion of the load utility with regards to the delimiter.

    Probably the load utility is getting the delimiter at an unexpected place and hence it is treating that as a end of row and causing the concern.

    However there is no way I think in which you can tell the load utility to load which record and which not.

    I hope I have understood clearly.
    HI,
    The delimiters are at the right place.
    This is the flat file
    A|x|y|z
    B|q|a|a
    C|s|s|s

    It inserts A into the table first and then C and then B.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Laod utility

    Unless you specify, MODIFIED BY ANYORDER LOAD command will load the records in the same order as the input file ...

    But, again, we need to understand what you mean by 'data is not in sequence' ?

    Cheers
    Sathyaram


    Originally posted by bgdeepak
    Hi,
    I am using the load utility to load data from the files.The load inserts the data in the sequence in which data is present for most files.For some files the load utility does not insert the data in the sequence it should insert.The last line gets inserted in the middle.Is there a way by which i could specify the load utility to load the data in the sequence in which it is present in the files?How do i go about this..

    With Regards,
    Deepak B G
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Sep 2003
    Posts
    14

    Re: Laod utility

    Originally posted by sathyaram_s
    Unless you specify, MODIFIED BY ANYORDER LOAD command will load the records in the same order as the input file ...

    But, again, we need to understand what you mean by 'data is not in sequence' ?

    Cheers
    Sathyaram
    HI,

    The sequence here means that the records should be inserted in the same order as they are present in the file.
    suppose the flat file contains
    aaaaa
    bbbbb
    ccccc

    The data inserted into the table should also be in the same order
    aaaaa --record1
    bbbbb --record2
    ccccc --record3

    but in some cases it is like as shown below
    aaaaa --record1
    ccccc --record2
    bbbbb --record3

    Thanks,
    Deepak B G

  6. #6
    Join Date
    Jul 2003
    Location
    Austin, TX, USA
    Posts
    278

    Explanations

    Hi,

    From what I can gather so far what is bothering you is that the output that you getting when you query the table is not in the pattern that the data was loaded.

    If yes then please note "that unless you have a index or you specify the order by clause in your query, db2 cannot gaurantee the way the return resultset will look like."

    To elaborate what that necesary means is that if you load data in a certain sequence and after that is successful select * from table will not always return the data in the pattern in which it was loaded.

    Hope that is explanatory and solves your problem.

    If not please post your table structure, a sample file and the script that you are using to load the data.

    That would be helpful as we can try and reproduce the same at our end and get a better idea of your issue.
    HTH

    Nitin

    Ask the experienced rather than the learned

Posting Permissions

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