A. The number of fields in the data file is less than the number of column fields in the table, but the missing columns in the data file can be empty in the table definition.
-----This is relatively simple, just write the name of the column in the data file to the control file. Because Sql*loader is based on the name of the field given in the control file and the location of the field in the data file, the data import is completed.
B. The number of fields in the data file is less than the number of column fields in the table, but the missing columns in the data file cannot be empty in the table definition and must be assigned a value.
-----This is a relatively minor problem, you cannot complete the mapping and data import through simple positional binding.
C. The number of fields in the data file is greater than the number of column fields in the table
-----Use the filler parameter in the control file to transition the unwanted columns in the data file
============================================
1. The field in the data file is less than the field in the table and is not allowed to be empty
Data files:
7369 SMITH Clerk
7499 ALLEN Salesman
7521 WARD Salesman
7566 Jone Smanager
Control files:
LOAD'D:\oracletest\ldr_tab_fiile.dat'REPLACE into TABLE by-- if you want to import the source file This column content is empty, in the import into the database table, this column content is null(empno,ename,job , COMM "0-- assuming that the field COMM is not allowed to be empty is assigned a value of 0)
2. The fields in the data file are Gedo than the characters in the table
The
Data file is as follows:
7369 AAA SMITH 111 clerk
7499 BBB ALLEN 222 salesman
7521 CCC WARD 333 salesman
7566 DDD jone 444 S The MANAGER
needs the second and fourth columns in the staging data file, and the control file is as follows:
LOAD'D:\oracletest\ldr_tab_fiile.dat'REPLACE into TABLE by-- if you want to import the source file This column content is empty, in the import into the database table, this column content is null(empno,data_col2 Filler,ename,data_col4 Filler,job,comm "1")
====
Data_col2, Data_col4 These two are casually named.
SQLLoader4 (the columns in the data file are inconsistent with the columns in the table-filler)