使用CSV文件中的值更新Oracle表 [英] Update Oracle table with values from CSV file

查看:188
本文介绍了使用CSV文件中的值更新Oracle表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CSV文件,其中包含ID和其他几列。我也有一个表在oracle其中ID标识一行。我如何最好用CSV文件中的值替换表中的值,同时保持其他列的方式不变?

I have a CSV file which contains an ID and several other columns. I also have a table in oracle where the ID identifies a row. How can I best replace the values that are in the table with the values in the CSV file while keeping the other columns the way they were before?

这需要使用oracle本身提供的工具(即PL / SQL或SQL脚本),我不能使用真正的脚本语言(Python,。 ..)或真实程序。

This has to be done with tools available in oracle itself (i.e. PL/SQL or SQL scripts), I can not use a "real" scripting language (Python, ...) or a "real" program.

感谢,
Thomas

Thanks, Thomas

推荐答案

查看Oracle文档中的EXTERNAL TABLES。您可以将csv文件复制到Oracle服务器框,并让Oracle将其显示为一个正常表,您可以在其上运行查询。

Look at EXTERNAL TABLES in the Oracle doc. You can copy the csv file onto the Oracle server box and get Oracle to present it as a "normal" table on which you can run queries.

外部表非常适用于处理这样的数据加载。

External tables are really very useful for handling data loads like this.

这篇关于使用CSV文件中的值更新Oracle表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆