If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Laod utility

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-30-04, 00:29
bgdeepak bgdeepak is offline
Registered User
 
Join Date: Sep 2003
Posts: 14
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
Reply With Quote
  #2 (permalink)  
Old 03-30-04, 01:10
nitingm nitingm is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 03-30-04, 01:16
bgdeepak bgdeepak is offline
Registered User
 
Join Date: Sep 2003
Posts: 14
Re: Delimilter

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 03-30-04, 03:39
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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


Quote:
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.
Reply With Quote
  #5 (permalink)  
Old 03-30-04, 03:49
bgdeepak bgdeepak is offline
Registered User
 
Join Date: Sep 2003
Posts: 14
Re: Laod utility

Quote:
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
Reply With Quote
  #6 (permalink)  
Old 03-30-04, 04:19
nitingm nitingm is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On