DB2 Programming Skills (i)

Source: Internet
Author: User
Tags db2 db2 installation error handling create database
1 DB2 Programming
1.1 When you create a stored procedure, you must not use the TAB key 3
1.2 Use temporary table 3
1.3 Take the first few records from the datasheet 3
1.4 Use of Cursors 4
Note Commit and rollback 4
Two ways to define a cursor 4
method to modify the current record of a cursor 5
1.5 transcoding operations similar to decode 5
1.6 Similar charindex find character position in string 5
1.7 Similar DATEDIF calculates the difference days of two dates 5
1.8 Example of writing UDF 5
1.9 CREATE table 6 with identity values (that is, automatically generated IDs)
1.10 Prevention of field null value processing 6
1.11 Number of records processed 6
1.12 Usage of result set (cursor) returned from stored procedure 6
1.13 Type conversion Function 8
1.14 Mutual invocations of stored procedures 8
1.15 C Stored Procedure parameters Note 8
1.16 Stored Procedures fence and Unfence 8
1.17 SP Error Handling Usage 9
1.18 Import Usage 9
Use of 1.19 values 9
1.20 Specify isolation Level 10 for the SELECT statement
1.21 Atomic and not atomic difference 10
2 DB2 Programming Performance Note 10
2.1 Guide Table 10 of large data
2.2 SQL statements as much as possible write complex SQL 10
Choice of 2.3 SQL SP and C SP 10
2.4 Query Optimization (hash and RR_TO_RS) 11
2.5 methods to avoid using count (*) and exists 11
3 DB2 table and SP Management 12
3.1 See stored procedure text 12
3.2 View Table Structure 12
3.3 View the impact of each table on the SP (by which SP) 12
3.4 See what Table 12 the SP uses
3.5 See which SP is using the function 12
3.6 Modify Table Structure 12
4 DB2 System Management 13
4.1 DB2 Installation 13
4.2 Create DATABASE 14
4.3 Manual database Remote (alias) configuration 14
4.4 Stop starting database instance 14
4.5 Connection database and view current connection database 14
4.6 Stop starting database head 15
4.7 View and stop the database current application 15
4.8 See what database 15 is under this instance
4.9 View and change the configuration of the database head 16
4.9.1 the size of the sort heap 16
4.9.2 change the size of things log 16
4.9.3 to modify the heap memory size when the program heap memory is low 16
4.10 View and change the configuration of the database instance 16
4.10.1 turns on lock monitoring. 16
4.10.2 Change Diagnostics error Capture level 17
4.11 DB2 Environment variable 17
4.12 DB2 Command Environment setting 17
4.13 Change Isolation Level 17
4.14 Management Db\instance Parameters 18
4.15 Eliminate version issues after upgrade 18
4.16 View database table deadlock 18

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.