Oracle Import external files

Source: Internet
Author: User
Tags coding standards odbc

I. Import an Excel file using the PL/SQL Import Tool
1. Open PL/SQL and click T00ls->odbc in the menu bar Imtorper, open the ODBC Importer option box;
2. In the Data fromodbc page, select the format of the file you want to import, and select EXCELFiles. Enter the user name password. then click Connect;
3. In the pop-up Select Workbook dialog box, select the Excel file you want to import, click OK;
Click the table name in the import table in the Table/query that appears, and you can see the contents of the table you want to import in the Resultpreview below.
4. Click the Date to Oracle button, open the Date to Oracle Options box, select the name of the table you want to import,
This import table is Sfism4.u_rf_id_data, in the Owner drop-down menu selected SFISM4, in the Table drop-down menu select U_rf_id_data, in the fields select the field you want to import, this import field is Serial_ Number, click Import to import the batch data into the Oracle database so that the import data is complete.

two. Import txt file using Sqlldr
1. Write control file
Load data
infile ' c:/users/administrator/ Desktop/ctl.txt '
Append into table Test
Fields terminated by ' | '
(
SEQ,
NAME,
Name_busi,
Name_account,
Account,
Bank_name
)

2. Enter the command in the DOS window
C:\users\administrator>sqlldr Userid=username/[email protected] Control=c:\users\administrator\desktop\sql.ctl ,
(Note: The Local service name for the userid= username/user Password @ DB instance.) )
at the beginning of this sentence, the error:
sql*loader-704: Internal error: Ulconnect:ociserverattach [0]
Ora-12154:tns: Unable to resolve the specified connection identifier
Later found that there are two tnsnames.ora files, one belonging to Oralceclient, a oracledatabase, the usual database instance local configuration is written in the Oralceclient
Under the Tnsnames.ora, the Tnsnames.ora content under Oralceclient is copied to Tnsnames.ora under Oracledatabase, and the command runs successfully.
Although the import was successful, the imported data was incomplete and garbled in Chinese. Run SELECT * FROM Nls_database_parameters and select * from Nls_instance_parameters
found that the character set in Nls_database_parameters is ZHS16GBK, and the imported TXT file character set is UTF8, so after notepad++ can only convert the TXT file to ANSI (GBK) encoding,
The import is correct.

Attached: ANSI Encoding
To enable the computer to support more languages, you typically use the 0x80~0xffff range of 2 bytes to represent 1 characters. For example: Chinese characters ' in '
In the Chinese operating system, use [0xd6,0xd0] This two bytes of storage.
Different countries and regions have set different standards, resulting in GB2312, GBK, GB18030, Big5, Shift_JIS and other coding standards.
These use multiple bytes to represent a single character in a variety of Chinese character extension encodings, called ANSI encodings.
In the simplified Chinese Windows operating system, ANSI encoding represents GBK encoding; in traditional Chinese Windows operating system, ANSI coding represents BIG5;
In the Japanese Windows operating system, ANSI encoding represents SHIFT_JIS encoding.
Different ANSI encodings are incompatible, and when information is exchanged internationally, text that is in two languages cannot be stored in the same piece of ANSI-encoded text.
ANSI encoding denotes English characters with one byte, representing Chinese in two or four bytes.

Oracle Import external files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.