11-05-03, 13:39 #1Registered User
- Join Date
- Oct 2003
Unanswered: [LOAD] UDB v.7 statement: correct?
I'm currently working on a small business database and now it is time to populate it with some data. For this purpose I'll use the LOAD utility. Unfortunately, I will not have any DB2 access till next month, so there is no possibility for me to prove, if the statements are actually correct... It would be very cool, if you could take a look at this.
DEPTFILE has 4 elements:
EL1 positions 01 to 04
EL2 positions 05 to 20
EL3 positions 21 to 40
EL4 positions 41 to 44
DEPTTABLE has 4 columns
COL1 CHAR 4 NOT NULL
COL3 VARCHAR 16 NOT NULL
COL4 VARCHAR 20
COL1 = "department shortcut"
COL2 = "number of employees"
COL3 = "department title"
COL4 = "comment"
COL1 is primary key!
The following command sould delete all existing data from the table
und populate it with the input data.
db2 load data
modified by striptblanks usedefaults
method L (1 4,5 20,21 40,41 44)
null indicators (0, 0, 21, 41)
replace into DEPTTABLE (COL1, COL3, COL4, COL2)
If there are only blanks between 41 and 45, the value in COL2 will be NULL (no employees in the department). Zero would do just fine, but it's only an example.
If there are only blanks between 21 and 40, the value in COL4 will be NULL.
I do appreciate everyones help!!!
Thanks in Advance,
P.S. Sorry for my bad English...
11-05-03, 14:01 #2:-)
Provided Answers: 1
- Join Date
- Jun 2003
- Toronto, Canada
Re: [LOAD] UDB v.7 statement: correct?Originally posted by stefanB
Unfortunately, I will not have any DB2 access till next month, so there is no possibility for me to prove, if the statements are actually correct...
P.S. Your LOAD statement looks correct to me.---
"It does not work" is not a valid problem statement.