Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    18

    Arrow Unanswered: [LOAD] UDB v.7 statement: correct?

    Hi NG,

    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
    COL2 INTEGER
    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
    from DEPTFILE
    of asc
    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,

    S.B.

    P.S. Sorry for my bad English...

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    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...
    You can download trial version of DB2 from the IBM web site

    http://www14.software.ibm.com/webapp...c&cat=database

    P.S. Your LOAD statement looks correct to me.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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