当前位置:网站首页>Oracle-sqlload import external data details

Oracle-sqlload import external data details

2022-06-25 03:47:00 Diving rice awn

1.cmd Control side syntax

sqlldr userid= Database connection control= Control documents log=/tmp/test.log data=/tmp/test.csv rows=10

userid – Oracle Of username/password[@servicename]
control – Control documents , May contain table data
log – Record the log file at the time of import , The default is Control documents ( Remove the extension ).log
bad – Bad data files , The default is Control documents ( Remove the extension ).bad
data – Data files , It is generally specified in the control file . It is more suitable for automatic operation to control files with parameters without specifying data files
errors – Number of error records allowed , You can use him to control a record. You can't be wrong
rows – How many records are submitted once , The default is 64
skip – Number of lines skipped , For example, the first few lines of the exported data file are headers or other descriptions

eg:sqlldr user name / password @ Database name control=control.ctl data=T.txt log=filename.log

2. Control documents
  1. insert -- By default , The table is required to be empty at the beginning of the data load
  2. append -- Appends a new record to the table
  3. replace -- Delete old records ( use delete from table sentence ), Replace with a newly loaded record
  4. truncate -- Delete old records ( use truncate table sentence ), Replace with a newly loaded record

load data
infile ‘ File path to import ’
append into table Table name
FIELDS TERMINATED BY whitespace // Each line of data is recorded with Space Separate
trailing nullcols // It is allowed to be empty when the field of the table has no corresponding value
(
Field 1,
Field 2
)

eg:load data
infile ‘F:\T.txt’
append into table yangzh_owefee
FIELDS TERMINATED BY whitespace
trailing nullcols
(
USER_ID,
CONTRACT_NO,
deal_date,
owe_fee
)

原网站

版权声明
本文为[Diving rice awn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210538446108.html