Turn on spool and save to file a.txt How to use spool Turn on spool and save to file a.txt SQL> spool a.txt SQL> describe sample.department Name Null? Type ----------------------------------------- -------- ---------------------------- DNAME NOT NULL VARCHAR2(15) DNUMBER NOT NULL NUMBER(1) MGRSSN NUMBER(9) MGRSTARTDATE CHAR(9) SQL> spool off Turn off spool
How to use SQL Loader Create the database tables Load data using SQL Loader utility sqlloader.sql create table movies ( id number(5) primary key, title varchar2(40), director varchar2(20), actor varchar2(20) ); Separate utility. Run at command prompt main201> sqlldr control=movies.ctl log=movies.log bad=movies.bad;
How to use SQL Loader movies.ctl movies.txt LOAD DATA INFILE movies.txt INSERT INTO TABLE movies FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' (id, title, director, actor) movies.txt 1,'Gone with the Wind','Fleming','Gable' 2,'Gone with the Wind','Fleming','Howard' 3,'Gone with the Wind','Fleming','Leigh'