After completing this lab you should be able to:
SQL> desc stock_price Name Null? Type ------------------------------- -------- ---- SYMBOL NOT NULL VARCHAR2(5) CLOSE_DATE NOT NULL DATE SEQ_NO NUMBER OPEN NUMBER(8,4) HI NUMBER(8,4) LO NUMBER(8,4) CLOSE NUMBER(8,4) VOLUME NUMBER(12)
options (direct=false, rows=50000) load data infile 'stocks.csv' append discardmax 10 into table stock_price fields terminated by ',' trailing nullcols (symbol, close_date date "YYYYMMDD", open, hi, lo, close, volume)You will create this control file with a text editor. This is not a SQL file so don't create this in sqlplus, don't run it in sqlplus.
sqlldr userid=user/password control=stocks.ctlYou can simply type sqlldr at the command line to get help for this utility. Also, sqlldr is another alternate spelling for the command.
You will also need to the following to make the external table work when you select from it:
create table droberts.stock_price_external ( symbol varchar2(5), ...) organization external (type ORACLE_LOADER default directory N311_DIR access parameters (records delimited by newline badfile DALE_DIR:'extload.bad' logfile DALE_DIR:'extload.log' fields terminated by ',' (symbol char(5),...