我在查询从文件加载的下表时遇到问题。
CREATE TABLE "testTable"
(
"EAN" NUMBER(38,0),
"STOCK" NUMBER(38,0),
"SECCION" NUMBER(38,0)
)
organization external
( default directory xtern_data_dir
access parameters
( fields terminated by ';'
badfile xtern_data_dir:'testTable.bad'
logfile xtern_data_dir:'testTable.log'
discardfile xtern_data_dir:'testTable.dsc'
)
location ('0025_STOCK.csv')
)
但我收到以下错误:
KUP-01005: syntax error: found "badfile": expecting one of: "column, enclosed, (, ltrim, lrtrim, ldrtrim, missing, notrim, optionally, rtrim, reject"
我已经尝试删除badfile,logfile和discardfile,但后来又出现了另一个错误,我不知道如何让它工作。
请帮忙!提前谢谢。
答案 0 :(得分:1)
尝试使用
CREATE TABLE "testTable"
(
"EAN" NUMBER(38,0),
"STOCK" NUMBER(38,0),
"SECCION" NUMBER(38,0)
)
organization external
( default directory xtern_data_dir
access parameters
( RECORDS DELIMITED BY newline
badfile xtern_data_dir:'testTable.bad'
logfile xtern_data_dir:'testTable.log'
discardfile xtern_data_dir:'testTable.dsc'
fields terminated by ';'
)
location ('0025_STOCK.csv')
)