将 Excel 文件导入 Oracle
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1087453/
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
Import Excel File into Oracle
提问by Jeff
I have an Excel file that I need to import into a (new) Oracle table. What is the best way to do this?
我有一个 Excel 文件,我需要将它导入到(新的)Oracle 表中。做这个的最好方式是什么?
采纳答案by hadi teo
回答by ConcernedOfTunbridgeWells
The simplest (technically) way is to export the contents as a CSV and use SQL*Loader to import it into the table. This linkgoes to the documentation for SQL*Loader, which will explain how to write a SQL*Loader control file.
最简单(技术上)的方法是将内容导出为 CSV 并使用 SQL*Loader 将其导入表中。 此链接指向SQL*Loader 的文档,该文档将解释如何编写 SQL*Loader 控制文件。
If you need to automate the export to CSV this can be done through OLE automation or VBA code within the spreadsheet. You could also use VBA (shell) to execute the SQL*Loader command if you want to provide a facility for the end-user to initiate the load.
如果您需要自动导出到 CSV,这可以通过电子表格中的 OLE 自动化或 VBA 代码来完成。如果您想为最终用户提供启动加载的工具,您还可以使用 VBA ( shell) 来执行 SQL*Loader 命令。
回答by Shoban
回答by Jeffrey Kemp
I'm pretty sure it's possible to set up an Excel file as an ODBC source, but don't ask me how to do that.
我很确定可以将 Excel 文件设置为 ODBC 源,但不要问我如何做到这一点。
I generally just save the spreadsheet as CSV and import it using Oracle APEX's CSV import wizard.
我通常只是将电子表格保存为 CSV 并使用 Oracle APEX 的 CSV 导入向导导入它。
回答by Dana the Sane
If you need to perform any validation or cross-referencing on the data, I suggest using an entity relationship manager like Talend, etc. You can write scripts to do things like this, but a tool can make this a bit less painful.
如果您需要对数据执行任何验证或交叉引用,我建议使用像 Talend 等实体关系管理器。您可以编写脚本来执行此类操作,但使用工具可以减轻这种痛苦。