sql - oracle external table load -


i have 100 records in players.dat file

 pit   indianpolish  colts 

and new line same again. how can load data external table?

here table definition:

create table teams1(      team_id varchar2(20)      , team_name varchar2(35)     )  organization external (      type oracle_loader      default directory data_warehouse     access parameters (          records delimited newline          fields terminated whitespace          missing fields values null (              team_id varchar(20),             team_name varchar2(35)              terminated '/n')             )      location ('nfl_teams.dat') ) ; 

here error:

ora-29913: error in executing odciexttableopen callout  ora-29400: data cartridge error  kup-00554: error encountered while parsing access parameters  kup-01005: syntax error: found "fields": expecting 1 of: "field"  kup-01007: @ line 3 column 9 29913. 00000 - "error in executing %s callout" 

the error message points syntax problem, gives clue.

kup-01005: syntax error: found "fields": expecting 1 of: "field"  

sure enough, table definition has ...

missing fields values null  

... when should this:

missing field values null  

you have major problem data file. table definition specifies fields terminated whitespace sample data shows team name consisting of 2 words,indianpolish colts. won't able load that.

the best solution providing system right thing , supply data file uses sensible field delimiter and/or field enclosure. (if school assignment can yourself.)

a less desirable solution pre-process data file, using regex delimit or enclose fields.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -