The role of data movement in the IBM DB2 database

Source: Internet
Author: User
Tags ibm db2 ibm db2 database

This article mainly introduces the data movement function of the IBM DB2 database, this section describes how to use commands of the DB2 database to import and load data from files in a certain format to tables in the database.

The so-called data movement in DB2 includes:

1. import Data)

2. Data export (export)

3. load)

Both import and load use db2 commands to save data in files of a certain format to tables in the database.

Export refers to saving the data in the table of the db2 database to a file of a certain format.

The role of data movement:

To transfer data between different database management systems, data movement is usually the most practical method, because any database management system supports common file formats, this universal interface makes it easy to transfer data between different systems.

Among the three commands, export is the simplest. Because data is transferred from a table to a file, there is usually no error or illegal data.

Before explaining commands, first introduce the file format.

1. asc -- a non-bounded ascii file, which is an ascii plain stream. The rows in the data stream are separated by line delimiters, and each column in the row is defined by the start and end positions. For example:

 
 
  1. 10 head Office 160 corporate new york  
  2. 15 new england 50 eastern boston  
  3. 20 mid atlantic 10 eastern washington  
  4. 38 south atlantic 30 eastern atlanta  
  5. 42 great lakes 100 midwest chicago  
  6. 51 plains 140 midwest dallas  
  7. 66 pacific 270 western san francisco  
  8. 84 mountain 290 western denver  

2. del -- specifies an ascii file, which is also an ascii transfer stream. The rows in the data stream are separated by line delimiters, and the column values in the rows are separated by column delimiters. File Type modifiers can be used to modify the default values of these delimiters. For example:

 
 
  1. 10,"head office",160,"corporate","new york"  
  2. 15,"new england",50,"eastern","boston"  
  3. 20,"mid atlantic",10,"eastern","washington"  
  4. 38,"south atlantic",30,"eastern","atlanta"  
  5. 42,"great lakes",100,"midwest","chicago"  
  6. 51,"plains",140,"midwest","dallas"  
  7. 66,"pacific",270,"western","san francisco"  
  8. 84,"mountain",290,"western","denver"  

The above content is an introduction to the role of data movement in the IBM DB2 database. I hope you will have some gains.

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.