How to transfer the data from CSV file to Oracle database use the PL/SQL developer tool
来源:互联网 发布:bitcomet端口阻塞问题 编辑:程序博客网 时间:2024/05/23 19:14
1. Open the PL/SQL developer tool, enter the user name, password and the database name that your target database.
2. Click the Tools Option of menu bar of the PL/SQL developer tool, and select option.
With the text importer you can import ASCII files into the database. Most line oriented formats like comma and tab separated fields are supported. The importer will try to determine the file format automatically, so most of the time you don’t need to define anything, just select the file, select a table, and that’s it.
When you open the text importer, you will get something like the following:
3. Click the button open a data file(just select the source data file), and you will get something like the following.
If you select a csv file, the data will be show as follow:
The importer loads the first 100 lines from the file, this raw data is shown in the top "File Data" section. The middle section allows you to make the definition of the text file. The bottom "Result Preview" has a grid with the data as it would be imported.
4. Configure the data field format for the data file that you need transferred, maybe you will get the information like this.
You can adjust the field one by one as you want. The configuration is auto determined as soon as you load a file, but if this is not correct, you can create of modify this yourself. Set the Fieldcount to the correct number, and select a field from the field list to define a field definition. In the file data section, the specified field data is highlighted, allowing you to check if the field definition is correct. You have the following options to configure the text import definition:
- General --Fieldcount The number of fields per record. - General --Name in Header Indicates if the first record holds the fieldnames. - General --Quote Character Indicates the string characters, usually double or single quotes. - Field Start --Relative Position The field starts at a relative position to the end of the previous field. 0 indicates that the field starts where the previous field ended. - Field Start --Absolute Position This indicates that the field starts at a fixed position. - Field Start --Character This indicates that the field starts with a specific character. This is relative to the end of the previous field. - Field End --Length Indicates that the field has a fixed length. - Field End –Character Indicates that the field end with a specific character. |
5. If configure finished, click the tab to configure the relational of target data table. You will get something like this.
The top section has some general import parameters. The "Fields" section allows you to associate text file fields and Oracle fields. The bottom section is the result preview for your information.
6. Configure the database information.
You can set the following general preferences:
- Table The Oracle table (or view) you want to import the data to. After selecting a table, the importer will try to determine the field and field types automatically. This will only work if the text file has a header. - Commit every?Indicates after how many records you want to do a commit. If you set this to 0, all data will be committed at the end of the entire import. - Overwrite Duplicates A duplicate record will be updated in the database - Ignore Duplicates Duplicate records will be ignored. |
7. Configure the database field information.
In the field definition you see a list with fields from the text file. For every field you can set the following:
- Field The Oracle field you want to associate with the text field. You can leave this empty if you don抰 want to import this field. - Fieldtype The basic fieldtype: String, Number or Date. - SQL function This option allows you to define additional SQL processing. For date fields a to_date function is added automatically. This is a very powerful option, allowing you to convert the imported data. Basically, you can enter anything that can be processed by Oracle. You can add a # to indicate the data. The "Create SQL" button will fill this field with a to_date function for date fields |
8. If configure finished, you will get something like this.
When the definition is complete, you can decide to save it. The toolbar has buttons to save and load definition files. The text importer will remember which definition file was used for which text file, and the definition file will be loaded automatically the next time you open the same text file.(Optional)
9. Click the button of the bottom window, put the data of the CSV file to Oracle table that you configure.
You have two import buttons, "Import" and "Import to Script". The fist option will start importing the data into the selected table. The second option will create an SQL script with insert statements.
If the data load finished, you can see the
10. Validate the data transfer has done.
Open a new SQL window of the PL/SQL developer tool.
Input the query SQL script, select it then click the function key F8 run it.
You should be got the data in result window that the data from data file. If you get the data of you want, congratulation, you are successful.
- How to transfer the data from CSV file to Oracle database use the PL/SQL developer tool
- Import Data from csv file to Azure SQL DATABASE
- How to display the data from database on JTable
- HOW TO Use the GCC specs file
- How to use PL SQL Developer in Ubuntu
- How to read data from csv file in c#
- How to use the Sql Tuning Advisor
- How To Load CLOB Data from a File into a CLOB column using PL/SQL
- Script do the data transfer from target server to local
- Import data from EXCEL to Oracle table with PL/SQL Developer
- R12 adbldxml.pl AutoConfig Tool to Generate the Context File
- How to use obex-data-server to transfer a file on ARM-xScale platform (原创)
- How to use the Automatic Database Diagnostic Monitor (ADDM)
- How to change the language to English for Oracle SQL Developer
- How to change the language to English for Oracle SQL Developer
- How to see all the application errors related to SQL Server and export them to a .csv file.
- How to change the language to English for Oracle SQL Developer(如何将SQL developer改成英文界面)
- How to change the language to English for Oracle SQL Developer(如何将SQL developer改成英文界面)
- javascript下载文件
- Big endian and little endian
- 菜鸟浅谈Linux内核编译过程...
- linux bible 第十五章 Linux核心数据结构
- 用socket获取主机的信息
- How to transfer the data from CSV file to Oracle database use the PL/SQL developer tool
- 测试!
- 安装sqlserver2000的时候安装过某个文件创建挂起的文件操作?处理时最简单的方法
- linux bible 第十四章 Linux核心资源
- Get the parameter of webservice xml
- linux bible 第十三章 处理器
- linux bible 第十二章 模块
- linux bible 第十一章 核心机制
- 2008年10月17日 第一天的博客