473,503 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

db2 load


I have a shell script I am trying to run that loads a table from a
control file. The file I am trying to load is delimited by the "}"
character. How do I set the delimeter code? Here is my load
statement:

db2 load client from /loadspace/re000000.txt of del replace into
INET.INSRP_SURP_PROP_TBL nonrecoverable
To be even more explicit, I am trying to replicate the below oracle
load command in DB2:

OPTIONS(ERRORS=10)
LOAD DATA
INFILE '/loadspace/re000000.txt'
BADFILE '/home/prgyw1/re000000.bad'
DISCARDFILE '/home/prgyw1/re000000.dsc'
REPLACE
INTO TABLE INSRP_SURP_PROP_TBL
(
insrp_prop_addr TERMINATED BY '}',
insrp_prop_cty TERMINATED BY '}',
insrp_prop_st TERMINATED BY '}',
insrp_prop_zip TERMINATED BY '}',
insrp_prop_sub_catg TERMINATED BY '}',
insrp_prop_sq_footage TERMINATED BY '}' OPTIONALLY ENCLOSED BY '.',
insrp_prop_nbr TERMINATED BY '}',
insrp_prop_stat TERMINATED BY '}',
insrp_prop_srp TERMINATED BY WHITESPACE

Thanks!
--
jrthor2
------------------------------------------------------------------------
jrthor2's Profile: http://www.dbtalk.net/m455
View this thread: http://www.dbtalk.net/t314419

Jun 20 '06 #1
6 8860
If the INPUT file is a del file type { then you use this syntax

db2 "load from <file> of <type> modified by chardel{ insert/replace
into <table>
nonrecoverable"
cheers...
Shashi Mannepalli

jrthor2 wrote:
I have a shell script I am trying to run that loads a table from a
control file. The file I am trying to load is delimited by the "}"
character. How do I set the delimeter code? Here is my load
statement:

db2 load client from /loadspace/re000000.txt of del replace into
INET.INSRP_SURP_PROP_TBL nonrecoverable
To be even more explicit, I am trying to replicate the below oracle
load command in DB2:

OPTIONS(ERRORS=10)
LOAD DATA
INFILE '/loadspace/re000000.txt'
BADFILE '/home/prgyw1/re000000.bad'
DISCARDFILE '/home/prgyw1/re000000.dsc'
REPLACE
INTO TABLE INSRP_SURP_PROP_TBL
(
insrp_prop_addr TERMINATED BY '}',
insrp_prop_cty TERMINATED BY '}',
insrp_prop_st TERMINATED BY '}',
insrp_prop_zip TERMINATED BY '}',
insrp_prop_sub_catg TERMINATED BY '}',
insrp_prop_sq_footage TERMINATED BY '}' OPTIONALLY ENCLOSED BY '.',
insrp_prop_nbr TERMINATED BY '}',
insrp_prop_stat TERMINATED BY '}',
insrp_prop_srp TERMINATED BY WHITESPACE

Thanks!
--
jrthor2
------------------------------------------------------------------------
jrthor2's Profile: http://www.dbtalk.net/m455
View this thread: http://www.dbtalk.net/t314419


Jun 20 '06 #2

I got the columns in the correct order now on my table, but when I run
the load comand, I get this in my log file:

SQL3109N The utility is beginning to load data from file
"/loadspace/re000000.txt".

SQL3500W The utility is beginning the "LOAD" phase at time
"06/21/2006
15:31:32.235126".

SQL3519W Begin Load Consistency Point. Input record count = "0".

SQL3520W Load Consistency Point was successful.

SQL3137W Row "F0-1" is too short. At least one input value being
loaded to a
non-nullable column is missing. The row was not loaded.

SQL3185W The previous error occurred while processing data from row
"F0-1" of
the input file.

I get this for each row it tries to read (210 rows), then it goes to
this:

SQL3227W Record token "F0-1" refers to user record number "1".

Again, I get this for each record (210), then I get this:

SQL3110N The utility has completed processing. "210" rows were read
from the
input file.

SQL3519W Begin Load Consistency Point. Input record count = "210".

SQL3520W Load Consistency Point was successful.

SQL3515W The utility has finished the "LOAD" phase at time
"06/21/2006
15:31:34.322788".

SQL3107W There is at least one warning message in the message file.
Number of rows read = 210
Number of rows skipped = 0
Number of rows loaded = 0
Number of rows rejected = 210
Number of rows deleted = 0
Number of rows committed = 210

The load does not put anything in the database. Could someone please
help me get this working.

Thanks a million!!!
--
jrthor2
------------------------------------------------------------------------
jrthor2's Profile: http://www.dbtalk.net/m455
View this thread: http://www.dbtalk.net/t314419

Jun 21 '06 #3
Ian
jrthor2 wrote:
I got the columns in the correct order now on my table, but when I run
the load comand, I get this in my log file:


Why don't you post 1 or 2 records from your input file. That would make
it a lot easier to help you since most of us probably don't know Oracle
SQLLDR syntax.

FYI, you probably want "modified by COLDEL}" and not "modified by chardel}"
Jun 21 '06 #4

Sure, here is 3 rows from my delimited file:

37040.00}A}Oaklawn Blvd.}HOPEWELL}VA}23860}10818.00}Shopping Center}Yes
36320.00}A}SEC Old Highway 53 & Olympic
Drive}CLEARLAKE}CA}95422}101160.00}Land}Yes
37732.00}A}3422 Main Street}MARLETTE}MI}48453}8050.00}Shopping
Center}Yes

I get these errors with coldel}, sorry.
--
jrthor2
------------------------------------------------------------------------
jrthor2's Profile: http://www.dbtalk.net/m455
View this thread: http://www.dbtalk.net/t314419

Jun 22 '06 #5
Ian
jrthor2 wrote:
Sure, here is 3 rows from my delimited file:

37040.00}A}Oaklawn Blvd.}HOPEWELL}VA}23860}10818.00}Shopping Center}Yes
36320.00}A}SEC Old Highway 53 & Olympic
Drive}CLEARLAKE}CA}95422}101160.00}Land}Yes
37732.00}A}3422 Main Street}MARLETTE}MI}48453}8050.00}Shopping
Center}Yes


Are those linebreaks intentional, or do the appear because your
newsreader put them in.

Anyway, coldel} should work:

load from yourfile of del modified by coldel} insert into yourtable
If this fails, what's the error?
Jun 22 '06 #6

yes, the line break is because of the editor, each line is on one line.

My log is attached with the errors in it (I had to remove a bunch of
lines because ti was too big to attach, but you'll get the idea, I'm
sure). After this runs, my table does not have any data in it.

Thanks.
+-------------------------------------------------------------------+
|Filename: inwk292a_db2.txt |
|Download: http://www.dbtalk.net/a5 |
+-------------------------------------------------------------------+

--
jrthor2
------------------------------------------------------------------------
jrthor2's Profile: http://www.dbtalk.net/m455
View this thread: http://www.dbtalk.net/t314419

Jun 22 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
16048
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
6
4298
by: JS | last post by:
EE instance DB2 v7.2.0 fixpack 3 on WIN2K. I select some data from a table A and write it to a file using the COALESCE function and whitespace as the null character: eg coalesce(col1, ' '). This...
2
2007
by: **Developer** | last post by:
I have a Form (FV&C) containing a userconrtrol (CF&E) I do a ShowDialog for the form and the form's Load calls a method of the UserControl. The first time I do this the usercontrol appears on...
3
7159
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database...
1
3804
by: dbagirltx | last post by:
We have done some testing with mixed and forgotten results. So I'm hoping that asking here can clarify some issues for us. Right now we do one weekly warm backup. Throughout the week there are...
1
5892
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the...
2
14070
by: contractsup | last post by:
Environment: $ uname -a AIX <withheld2 5 000100614C00 $ db2level DB21085I Instance "<withheld>" uses "32" bits and DB2 code release "SQL08024" with level identifier "03050106"....
5
6040
by: danfan46 | last post by:
Hi. I'm on DB2 9.5.0.1 on Linux AMD 64 and the database has four partitions where catalog is on partion 0 and user data on 1 thru 3. After a load failure (path to load file was wrong) I...
2
6548
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
13
6575
by: rdudejr | last post by:
Hi all, I hardly ever make a post unless I am having a very purplexing issue, so this one should be good... I am trying to do a load against a database on an AIX server into a DB2 v9.1...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.