Demo of migrating data into or out of a database in a DB2 database table

Source: Internet
Author: User

The following article describes how to move data into or out of a database in a DB2 database table, I saw on the relevant website two days ago the actual operation steps for migrating data into or out of the database in the DB2 database table. I thought it was good and I would like to share it with you.

After creating a table that stores data in the DB2 database, you must be able to move the data into or out of the table. The simplest way to put data into a table is to use the INSERT command. To insert data, you must provide the tables and columns you want to insert and the data itself.

After creating a table that stores data in the DB2 database, you must be able to move the data into or out of the table. The simplest way to put data into a table is to use the INSERT command. To insert data, you must provide the tables and columns you want to insert and the data itself. After inserting data, you can select, update, or delete it.

This exercise demonstrates how to move data into or out of the database.

In the Control Center Object view, select the AUTHOR table in the Database List and click Open.

Figure 1. Control Center -- open a table

As shown in, click Add Row. Input the data in the column and submit the transaction.

Figure 2. Add rows

If no error occurs, no feedback is provided. Click Close to Close the Open Table window.

Open Command Editor through Tools> Command Editor. Manually enter the INSERT command, including the statements used to connect to the DB2 database:

 
 
  1. connect to hellowld;  
  2. insert into hwld.author values ('Claire', 1, 'DB2 UDB',  
  3. '<author_info> 
  4. <name>Claire</name> 
  5. <ID>1</ID> 
  6. <department> 
  7. <department_title>DB2 CE</department_title> 
  8. <responsibility>Supporting customer problems</responsibility> 
  9. <start_year>2005</start_year> 
  10. </department> 
  11. <department> 
  12. <department_title>DB2 Index Manager</department_title> 
  13. <responsibility>Develop new features for DB2 indexes</responsibility> 
  14. <start_year/> 
  15. </department> 
  16. </author_info>', 100);  
  17. terminate;   

(You can also use the command to edit the view to perform the same operation .)

Click the green triangle icon to run the command. Figure 3 shows the expected running results:

Figure 3. Command Editor -- insert

If there is data that is no longer needed in the table, you can delete it in the same window. Click AUTHOR and Open.

Select the first Row and click Delete Row. Click Commit to submit the deletion operation. If you decide to abort the delete operation, click Roll Back instead of Commit.

Click another row and delete it to clear the table, and then click Close. The above content describes how to move data into or out of the database in the DB2 database table, hoping to help you 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.