Induction of DB2 SQL statements (1)

Source: Internet
Author: User
Tags db2 sql statements

Add, delete, modify, query, and organize
Add
Insert into docsummitinfo (APPID, DOCRESULT, EXITVALUE, LOGDESC, DOCFLAG)
(Select appid, DOCRESULT, EXITVALUE, LOGDESC, DOCFLAG from docsummitinfoBAK)

Delete
1. delete from (Select * from autek. tempmainbak fetch first 20 rows only)

Delete the first 20 queried items

Modify
Query
Backup restoration
Import and Export
Import
1. db2 load from "C: \ 20110816 \ 20151116_bankenterpri

SeCA.txt "OF del modified by coldel0x7c replace into" AUTEK ". TEMPMAINBAK

 

Import the files separated by "|" into the table. 0x7C is the hexadecimal format of the vertical ascii code.

2. database characters of 1386 GBK

C: \ Documents ents and Settings \ Piggy> db2 load from "C: \ 20110816 \ 20151116_bankenterpri

SeCA.txt "OF del modified by codepage = 1386 coldel0x23 replace into" PIGGY ". TEMP

MAINBAK

Set characters
Db2set DB2CODEPAGE = 819

Db2set DB2CODEPAGE = 1208

The character set of the db2 database is:
> Db2 get db cfg for db_name

SQL sorting
1. SQL Server can be written

Case field when null

In DB2, the case when field is null.

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.