将数据从CSV导入到Oracle [英] Importing Data from CSV to Oracle

查看:384
本文介绍了将数据从CSV导入到Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想将数据从CSV导入到Oracle,而导入时我需要

使用所需的格式验证每个单元格数据,并需要检查列名是否相同.

请提出建议.

Hi
I want to Import the Data from CSV to Oracle, while importing i need to

validate each cell data with required format and need to check whether the column names are same or not.

Please suggest how to go ahead.

推荐答案

有很多选择:

1)您可以使用CodeProject中的文章来读取CSV文件(仅进行搜索)并自行执行逻辑.
2)有用于数据迁移的程序(仅搜索google).
3)SQL Server有一个可以执行此操作的数据转换向导.
There are a lot of options for this:

1) You can use articles in CodeProject for reading CSV files (just search) and doing the logic yourself.
2) There are programs for data migrations (just search google).
3) SQL server has a data transform wizard which can do this.


有很多方法可以解决此问题,并且从您的问题来看,您似乎需要执行一些指定的数据检查和验证,在这种情况下,您可以使用两件事

1)构建一个应用程序,该程序将从csv文件中读取数据进行验证,然后将其存储在某个脱机存储中(例如datatable),一旦所有有效数据都放在一个表中,就可以立即将数据插入Oracle数据库.始终将无效数据记录在某种文件或某种文件中是一个好习惯(这取决于您要如何操作)

2)在数据库中创建表并为列添加验证条件(类似的操作仅在日期和所有日期均有效时才允许插入).我认为这在Oracle中称为检查约束,然后您可以使用oracle提供的默认实用程序将数据插入表中并将无效数据保存到其他文件中.

希望对您有帮助
There is a lot of way to go about this problem and from your question it looks like you need to perform some specified data checks and validation and in this case you can use two things

1)Build an application which will read the data from csv file do the validation and then store it in some offline storage(like datatable) and once you have all the valid data in one table you can insert the data into Oracle database at once.it''s always a good practice to keep a record of invalid data in some sort of file or something(it''s up to you how you want to do that)

2)Create the table in the database and put a validation conditions for column (something like it will allow the inset only when the date is valid and all). I think it''s called check constraint in Oracle and then you can use the default utility provided by oracle to inset the data into table and save invalid data into some other file.

Hope this helps


这篇关于将数据从CSV导入到Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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