This discussion is archived
3 Replies Latest reply: Jan 29, 2013 8:56 AM by Chanchal Wankhade RSS

How to execute the SQL*Loader step by step

986043 Newbie
Currently Being Moderated
Hi,
R8 now I'm studying abt SQL*Loader. All I've learn it needs to have:
1. One text input file
2.Control file
3.Bad file...

But I'm confused where to put the input file...where to put the control file in which format and in control file what should I write...


My oracle version is:

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

Furthermore, Plz anybody can suggestme links for example with details. Thnx in advance.
Regards
Sonia.

Edited by: 983040 on Jan 27, 2013 11:02 PM

Edited by: 983040 on Jan 27, 2013 11:05 PM
  • 1. Re: How to execute the SQL*Loader step by step
    971895 Journeyer
    Currently Being Moderated
    if the file doesn't contain header row remove the SKIP=1 in the control file.
    Below code save to test.ctl in D drive.
    OPTIONS
    (SKIP=1)
    LOAD DATA
    INFILE 'd:\test.txt'
    INSERT
    INTO TABLE emp_info2
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    (
    empno,
    ename,
    description
    )
    and open the DOS prompt run the below command
    $sqlldr userid=scott/tiger control=test.ctl log=test.log 
  • 2. Re: How to execute the SQL*Loader step by step
    Srini Chavali-Oracle Oracle ACE Director
    Currently Being Moderated
    Pl see the documentation - http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_concepts.htm

    What have you tried so far ? What errors are you experiencing ?

    HTH
    Srini
  • 3. Re: How to execute the SQL*Loader step by step
    Chanchal Wankhade Journeyer
    Currently Being Moderated
    Hi,

    Sql * Loader is use to import flat files into the database very fast.

    Sql loader have first step to dicide which file needs to be import ie.(excel(.csv file), text file,dat file etc.)
    After you need to create control file for upload the data. control file is the code which tell oracle where is the source file, name of the table,column of the table and name of the column.
    values are seperated by which character like ',' or '|' etc.

    the you need to call the control file to execute the code you have specified inside.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points