Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Unanswered: 4 Rows not loaded because all WHEN clauses were failed ???

    Plz c my CTL file..

    LOAD DATA
    INFILE *
    APPEND
    INTO TABLE SCOTT.DEPT
    WHEN (01) = 'H' and (01) = 'T' and (3:7) = '1999'
    (
    DEPTNO "my_db_sequence.nextval",
    DNAME POSITION(01:2) CHAR,
    LOC POSITION(3:7) CHAR
    )
    BEGINDATA
    He1999
    Tr1999
    Na1999


    Y it fails???

    thanx 4 ur reply.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    At first sight ... how about this?

    WHEN (01) = 'H' OR (01) = 'T' and (3:7) = '1999'

    No, it won't work ... OR is not allowed here.

    I tried to do it on my database. You should correct third condition - it should be (3:6) instead of (3:7).

    Conditions "1 = H and 1 = T" are never true; AND causes failure. OR would be fine, wouldn't it?

    So, there's no record you try to load that satisfies all three conditions. That's why all of them fail to load.

    This control file works:
    Code:
    LOAD DATA
    INFILE *
    APPEND
    INTO TABLE dept
    WHEN (1) = 'H' and (3:6) = '1999'
    (
    DEPTNO "my_db_sequence.nextval",
    DNAME POSITION(01:2) CHAR,
    LOC POSITION(3:6) CHAR
    ) 
    
    INTO TABLE dept
    WHEN (1) = 'T' and (3:6) = '1999'
    (
    DEPTNO "my_db_sequence.nextval",
    DNAME POSITION(01:2) CHAR,
    LOC POSITION(3:6) CHAR
    )
    
    BEGINDATA
    He1999
    Tr1999
    Na1999
    Select from the DEPT table returns two records - those starting with He and Tr.
    Last edited by Littlefoot; 07-12-04 at 10:17.

Posting Permissions

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