Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Import a file in .csv format into an oracle database

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Import a file in .csv format into an oracle database

The first method

1. Selection tool-text importer

2. Select the data selection owner and table to oracle.

3. Choose to open the file and select the text to import

4. Configure the correspondence of the table in field. Filed1 corresponds to the first column in .csv. Configure the column of the corresponding data, and pay attention to the type, otherwise the imported data will report an error. After that, click Import and complete.

The second method

1. Create a control file

For example, create a test.ctl file in E:\ with the following contents

Load data-control file flag

File name and path to be entered by infile'e:/asd.csv'

Table to be inserted by into tablejyzxsj_rdl

Fields terminatedby','- to ask about the division symbol

(GUID,RDL,LJDL,DATETIME timestamp "yyyy-mm-dd")-defines the order in the column correspondence table

Note: date format needs to be formatted such as: DATETIME timestamp "yyyy-mm-dd"

Keywords that specify how data is inserted in the control file

Insert, which is the default, requires the table to be empty at the beginning of data loading

Append, adding new records to the table

Replace, delete the old record and replace it with the newly loaded record

Truncate, ditto

2. Execute the command under the dos window to realize data import

Sqlldr sgbiz/sgbiz@ip:1521/dljydbcontrol=e:/test.ctl log=e:/test.log

Attachment: http://down.51cto.com/data/2366650

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report