You can use a filler field to ignore the double-quote at the start of the record. This defines a filler field I've nominally called quote
which is terminated by the first "
:
options (skip=1)
load data
truncate into table t42
fields terminated by ' '
(
quote filler terminated by '"',
cust_id,
cust_name,
cust_level terminated by '"'
)
The value of that quote
field would be null in this case, but we're ignoring it anyway so that's not important.
With your data file as a table defined as:
create table t42(cust_id number, cust_name varchar2(20), cust_level number);
... your data is inserted as:
select * from t42;
CUST_ID CUST_NAME CUST_LEVEL
---------- -------------------- ----------
1 Eric Cartman 5
2 Kyle Broflovski 2
I've called the third column cust_level
because level
is a reserved word; you can force it to be used but it would cause you pain down the line. Also note I've used truncate
so this will replace any existing data in your table; if you're adding new data then change that to append
.