Wednesday, August 8, 2018

SQL Loader

C:\Users\MAK>sqlldr userid=MADHU/MADHU@ORCL data='C:\Users\MAK\ITG\Dept1
.csv' control='C:\Users\MAK\ITG\Dept1.ctl' bad='C:\Users\MAK\ITG\Dept1.b
ad' discard='C:Users\MAK\ITG\Dept1.dsc'

SQL*Loader: Release 12.2.0.1.0 - Production on Wed Aug 8 11:57:23 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-500: Unable to open file (C:\Users\MAK\ITG\Dept1.ctl)
SQL*Loader-553: file not found
SQL*Loader-509: System error: The system cannot find the file specified.
=====================================================================
=copy the control file to ......\bin\ folder in oracle home folder. =
=====================================================================
=---Control file--------------- ====
=load data =====
=insert =====
=into table dept_test =====
=fields terminated by "," optionally enclosed by "#" =====
=(deptno,dname,loc) =====
=====================================================================

C:\Users\MAK>sqlldr userid=MADHU/MADHU@ORCL data='C:\Users\MAK\ITG\Dept1
.csv' control='D:\app\product\11.2.0\dbhome_1\BIN\Dept.ctl' bad='C:\Users\MAK\ITG\Dept1.bad' discard='C:Users\MAK\ITG\Dept1.dsc'

SQL*Loader: Release 12.2.0.1.0 - Production on Wed Aug 8 12:02:41 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Path used:      Conventional
Commit point reached - logical record count 2
Commit point reached - logical record count 3

Table DEPT_TEST:
  3 Rows successfully loaded.

Check the log file:
  Dept.log
for more information about the load.

===========================================================
Delimiter Separated (, / # a x z) control file example:
-----------------------------------------------------------------
LOAD DATA
INSERT/TRUNCATE/APPEND
INTO TABLE DEPT_MAK
FIELDS TERMINATED BY "," OPTIONALLY BY "#"
(DEPTNO,DNAME,LOC)

=============================================================
Fixed position SQL Loader  control file example:
--------------------------------------------------------------------------------
LOAD DATA
INSERT/TRUNCATE/APPEND
INTO TABLE DEPT_MAK
TRAILING NULLCOLS
(
DEPTNO POSITION(1:2) INTEGER EXTERNAL(2),
DNAME POSITION(3:15) CHAR,
LOC POSITION(16:35) CHAR
)



No comments:

Post a Comment