Load data and set field terminated sign and OPTIONALLY ENCLOSed sign : CSV Load « Table « Oracle PL / SQL






Load data and set field terminated sign and OPTIONALLY ENCLOSed sign

 


create table dept
( deptno  number(2),
  dname   varchar2(14),
  loc     varchar2(13)
)
/

LOAD DATA                                                  
INFILE *                                                   
INTO TABLE DEPT                                            
REPLACE                                                    
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'        
(DEPTNO,
DNAME,
LOC
)                                                          
BEGINDATA                                                 
10,Sales,"""USA"""
20,Accounting,"BC,USA"
30,Consulting,BC
40,Finance,BC
50,"Finance","",BC
60,"Finance",,BC

drop table dept;

 








Related examples in the same category

1.Load CSV data to a table
2.FIELDS TERMINATED BY WHITESPACE
3.Indicate columns in load data statement
4.Set value position in load statement
5.Set ENTIRE_LINE in load data statement
6.Leave start position open in load data statement
7.Set char(count) for load data statement
8.Set date format in load data statement
9.Use string function in load data statement
10.Set entry line in load data statement
11.Trailing null columns when loading data
12.use case statement to check the value in load data statement
13.Use user-defined columns in load data statement