Reputation: 382
I have a folder with several file s but they are not .dat. For my surprise i Could load one file but only when I renamed to .dat . What Am I doing wrong or I need to rename all my files to .dat ? My Files does not have extensions
Thanks guys
controlfile
load data
infile 'D:\pageviews\year=2016\month=06\*'
replace
into table test
fields terminated by whitespace
trailing nullcols
(
c1,
c2,
c3,
c4
)
Upvotes: 1
Views: 1658
Reputation: 142710
As far as I can tell, INFILE
clause you use is wrong.
You should name a file you're loading. Asterisk is used when data (you're about to load) is contained within the control file itself (after the BEGINDATA
keyword).
If you don't specify a file extension, then it defaults to .dat (that's why you managed to load the file).
Possible cases (copied from the documentation):
INFILE *
INFILE foo
INFILE 'c:/topdir/subdir/datafile.dat'
Do read documentation; it'll be much more clear what you should (not) do.
Upvotes: 1