SQL Loader ?????
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: SQL Loader ?????

  1. #1
    Join Date
    Jul 2000
    Posts
    50

    Exclamation

    Hi all!

    Is it possible to load more than one table from one control file in one sql loader statement. eq.

    I got ten fields in my input file (P1 to P10). I got two tables (Table1 and Table2) where I want to load data. Values P1->P5 should go to Table1 and rest of data i.e. P6->P10 should populate in Table2. This should be done in one execution.

    Appreciate your view in advance.

    abhijit



  2. #2
    Join Date
    Jan 2000
    Posts
    21
    Yes, you can load multiple tables using one control file.

    Example:
    LOAD DATA

    INFILE 'example1.dat'

    BADFILE 'example1.bad'

    DISCARDFILE 'example1.dsc'

    APPEND/REPLACE

    INTO TABLE table1

    (p1 POSITION(1:4) INTEGER EXTERNAL,
    p2 POSITION(6:15) CHAR,
    ....)

    INTO TABLE table2
    WHEN p5 != ' '

    (p5 POSITION(25:27) INTERGER EXTERNAL,
    p6 POSITION(28:30) CHAR,
    ......)

    i hope this helps.

    vidhya

  3. #3
    Join Date
    Jul 2000
    Posts
    50
    Thanks a lot Vidhya.

    abhijit

Posting Permissions

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



Click Here to Expand Forum to Full Width