Objective: To import txt data to a database table Step 1: scott creates an empty table createtablefamily (idnumber (10), namevarchar (20), salnumber (20 ), totalnumber (30); Step 2: Create a txt data file: vioracleinput.txt 1, clark, saber
Objective: To import txt data to a database table Step 1: scott creates an empty table create table family (id number (10), name varchar (20 ), sal number (20), total number (30); Step 2: Create a txt data file: vi/oracle/input.txt 1, clark, 2, saber
Objective: To import txt data to a database table
Step 1: scott creates an empty table
Create table family (id number (10), name varchar (20), sal number (20), total number (30 ));
Step 2: Create a txt data file:
Vi/oracle/input.txt
1, clark
2, saber, 4100,40000
Step 3: Create an SQL * loader input control file:
Vi/oracle/input. ctl
Load data
Infile '/oracle/input.txt'
Into table family
Fields terminated ','
(Id, name, sal, total)
Step 4: Execute Import
Sqlldr scott/tiger control = '/oracle/input. ctl' log = '/oracle/input. Log'
Prompt that the import is complete:
Commit point reached-logical record count 2
Step 5: Check the table:
SQL> select * from family;
ID NAME SAL TOTAL
--------------------------------------------------
1 clark 4000 50000
2 saber 4100 40000