External file formats and ASCII files supported by the DB2 database

Source: Internet
Author: User

This article mainly tells you about the external file formats supported by the DB2 database-ASCII files with fixed record length. DB2 also supports fixed-length ASCII external file formats, which are sometimes called positional ASCII files.

The ASCII file format at the fixed record length position uses a fixed byte offset to replace the record separator to determine the boundary of each field. In short, in this file format, each record in the file (each field in the record) has a fixed length.

For example, the starting position of the N record is determined by the fixed length of the record multiplied by the product of N. The calculated value is the byte offset from the start point of the file. Not only is the length of the record row fixed, but the start position and end position of each column value in each record are also the same. That is, the length of each field is the same. However, if the actual content of a field does not reach this fixed width, it is often replaced by a space character.

However, this file format is much different from the previously mentioned ASCII file. Such as making this file is very troublesome and prone to errors. Inputting one or more spaces leads to Database Import errors. For example, Chinese characters and English characters occupy different positions. If the data file contains both Chinese and English characters, it is difficult to control the fixed length.

Therefore, like many database administrators, I do not set up the fixed-length ASCII file format. If you must use it, you must use professional tools to convert the file. For example, in Linux, you can use the redirection symbol to create a fixed-width ASCII file.

In short, if you create this file manually, there is a high possibility of errors. In the current DB2 database system, some import tools also support this format of external files. However, this format has been abandoned during data export. It can be seen that files in this format are exiting the historical stage.

The above content is an ASCII file with a fixed record length that explains the external file formats supported by the DB2 database. In this regard.

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.