0

我正在尝试将 csv 文件数据加载到 external_tables 中,为此我已经尝试过

  create table ext_table_csv (
      i   Number,
      n   Varchar2(20),
      m   Varchar2(20)
    )
    organization external (
      type              oracle_loader
      default directory ext_dir
      access parameters (
        records delimited  by newline
        fields  terminated by ','
        missing field values are null
      )
      location ('f

ile.csv')
)
reject limit unlimited;

但我得到了错误

Error starting at line 8 in command:

    create table ext_table_csv (
      i   Number,
      n   Varchar2(20),
      m   Varchar2(20)
    )
    organization external (
      type              oracle_loader
      default directory ext_dir
      access parameters (
        records delimited  by newline
        fields  terminated by ','
        missing field values are null
      )
      location ('f

ile.csv')
)
reject limit unlimited


Error at Command Line:15 Column:23
Error report:

    SQL Error: ORA-06564: object DATA_DIR does not exist
    06564. 00000 -  "object %s does not exist"
    *Cause:    The named object could not be found.  Either it does not exist
               or you do not have permission to access it.
    *Action:   Create the object or get permission to access it.

我要做的是我想从 ftp 位置读取 csv 文件。有没有办法实现这一点?

4

1 回答 1

0

您可能需要指定文件的位置。

 location (FTP_DIRECTORY:'emp.dat')

其中 FTP_DIRECTORY 是一个 Oracle Directory 对象,指向您放置文件的位置。

于 2014-03-04T13:13:35.427 回答