sql loader控制文件多重控制

时间:2014-04-04 04:34:30

标签: sql-loader

我有这样的原始数据:

2002-3,X52.9418.001 , Abraham, Kennedy James, 111111111, 2125551234,ak123n@aol.com, 123 East 14th Street,, New York, NY,
2002,X52.9418.001 , Richard, Roberts, 111111112, 2125554321,rr345@aol.com, 123 East 14th Street, Apt.6 , New York, NY, 10010, United States, English
2002-4,X52.9418.001 , Katherine Ray Baird , 111111113, (212) 555 3456,kbilu@aol.com, 123 East 14th Street,, New York, New York, 10010-, , 
...

我需要使用Sql Loader将原始数据加载到Oracle数据库中。我创建了这个控制文件:

load data
infile '/home/l/liuh/rawdata.txt'
badfile '/home/l/liuh/badfile.bad'
discardfile '/home/l/liuh/discardfile.discard'
into table students

trailing nullcols (
    Year                INTEGER EXTERNAL terminated by "-",
    Semester            terminated by ",",
    department          terminated by ".",
    course_number       terminated by ".",
    session_number      terminated by ",",
    first_name          CHAR(10)  terminated by " ",
    Middle_name         CHAR(15)  terminated by ",",
    last_name           CHAR(15)  terminated by ",",
    id                  INTEGER EXTERNAL  terminated by ",",
    area_code           terminated by " ",
    phone_number        terminated by ",",
    email_address       CHAR terminated by ",",
    Street1             terminated by "," ,
    street2             terminated by "," ,
    city                terminated by "," ,
    State_prov          terminated by "," ,
    postal_code         terminated by "," ,
    country             terminated by "," ,
    language            terminated by "," 
)

但我没有进入数据库。有人可以帮我控制文件吗?我觉得很难控制数据。感谢。

0 个答案:

没有答案