oracle 使用本地 CSV 文件创建表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31823146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:58:22  来源:igfitidea点击:

Creating Table using Local CSV File

oracleoracle-sqldeveloper

提问by Dritzz

I have the following query to create a table however the file name is located on my local machine (as I don't have access to the Oracle Box) how can I use a local file to create a table on the Oracle Database). All the examples I have seen assume the file is located on the Oracle Database Server.

我有以下查询来创建表,但是文件名位于我的本地机器上(因为我无法访问 Oracle Box)我如何使用本地文件在 Oracle 数据库上创建表)。我看到的所有示例都假设该文件位于 Oracle 数据库服务器上。

CREATE OR REPLACE DIRECTORY file_dir AS 'c:/temp';
GRANT WRITE ON DIRECTORY file_dir TO CPS_OWNER;

create table CPS_OWNER.TEMP_TOGGLE_LIST (
      USER_ID varchar2(30)   
    )
    organization external (
      type oracle_loader
      default directory file_dir
      access parameters (records delimited by newline fields)
     location ('users.csv')
  )
  reject limit unlimited;

回答by thatjeffsmith

Right click in SQL Developer on the Tables node in the connection tree.

在 SQL Developer 中右键单击连接树中的表节点。

Where to click

点击哪里

Select 'Import Data'

选择“导入数据”

Point to your CSV file.

指向您的 CSV 文件。

Go through the wizard.

通过向导。

I talk about this in detail with screenshots here.

我在这里用截图详细讨论了这一点

Or, watch the Movie.

或者,看电影