Exforsys

Home arrow Technical Training arrow Oracle 10g Training

SQL*Loader - Loading data from Command Prompt

Page 3 of 3
Author : Exforsys Inc.     Published on: 25th Jul 2005    |   Last Updated on: 21st May 2011

SQL*Loader - Loading Data from Data Files

Login to SQL Plus to remove the data we have loaded from OEM.

Launch Command Prompt

Sample Code
  1. sqlldr username/password@dbname control=commandload.ctl
Copyright exforsys.com



Ads
Here is the copy of the control file used in the example.

Sample Code
  1. LOAD DATA
  2. INFILE 'E:oraclesqlloadercommandload.dat' "STR 'rn'"
  3. APPEND
  4. INTO TABLE customer
  5. FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  6. (
  7.   FIRST_NAME CHAR,
  8.   LAST_NAME CHAR,
  9.   ADDRESS CHAR,
  10.   CITY CHAR,
  11.   COUNTRY CHAR
  12. )
Copyright exforsys.com



Here is the logfile generated from the above demo.

Sample Code
  1. SQL*Loader: Release 11.2.0.1.0 - Production ON Sun Mar 6 13:19:31 2011
  2.  
  3. Copyright (c) 1982, 2009, Oracle AND/OR its affiliates.  ALL rights reserved.
  4.  
  5. Control File:   commandload.ctl
  6. DATA File:      E:oraclesqlloadercommandload.dat
  7.   File processing OPTION string: "STR 'rn'"
  8.   Bad File:     commandload.bad
  9.   Discard File:  none specified
  10.  
  11.  (Allow ALL discards)
  12.  
  13. Number TO LOAD: ALL
  14. Number TO skip: 0
  15. Errors allowed: 50
  16. Bind array:     64 rows, maximum of 256000 bytes
  17. Continuation:    none specified
  18. Path used:      Conventional
  19.  
  20. TABLE CUSTOMER, loaded FROM every logical record.
  21. INSERT OPTION IN effect FOR this TABLE: APPEND
  22.  
  23.    COLUMN Name                  Position   Len  Term Encl Datatype
  24. ------------------------------ ---------- ----- ---- ---- ---------------------
  25. FIRST_NAME                          FIRST     *   ,  O(") CHARACTER            
  26. LAST_NAME                            NEXT     *   ,  O(") CHARACTER            
  27. ADDRESS                              NEXT     *   ,  O(") CHARACTER            
  28. CITY                                 NEXT     *   ,  O(") CHARACTER            
  29. COUNTRY                              NEXT     *   ,  O(") CHARACTER            
  30.  
  31.  
  32. Table CUSTOMER:
  33.  4 Rows successfully loaded.
  34.  0 Rows not loaded due to data errors.
  35.  0 Rows not loaded because all WHEN clauses were failed.
  36.  0 Rows not loaded because all fields were null.
  37.  
  38.  
  39. Space allocated for bind array:                  82560 bytes(64 rows)
  40. Read   buffer bytes: 1048576
  41.  
  42. Total logical records skipped:          0
  43. Total logical records read:             4
  44. Total logical records rejected:         0
  45. Total logical records discarded:        0
  46.  
  47. Run began on Sun Mar 06 13:19:31 2011
  48. Run ended on Sun Mar 06 13:19:31 2011
  49.  
  50. Elapsed time was:     00:00:00.05
  51. CPU time was:         00:00:00.03 )
Copyright exforsys.com




 
This tutorial is part of a Oracle 10g Training tutorial series. Read it from the beginning and learn yourself.

Oracle 10g Training

 

Comments