Answers

Question and Answer:

  Home  DB Development

⟩ How to create an external table?

//1st of all create a directory to store ur external table

CREATE DIRECORY EMP_DIR AS '/FLAT_FILES' ;

// now write the following line of code to create an

external table at that directory

CREATE TABLE OLDEMP(ENO NUMBER,ENAME CHAR(20),DOB DATE,)

ORGANIZATION EXTERNAL

( TYPE ORACLE_LOADER

DEFAULT DIRECTORY EMP_DIR

ACCESS PARAMETERS

(RECORDS DELIMITED BY NEWLINE

BADFILE 'BAD_EMP')

LOGFILE 'LOG_EMP'

FIELDS TERMINATED BY ','

(ENO CHAR , ENAME CHAR DOB CHAR DATE_FORMAT

DATE MASK "DD-MON-YYYY"

)

)

LOCATION ('EMP1.TXT')

)

PARALLEL 5

REJECT LIMIT 200;

 209 views

More Questions for you: