There are no modifications in the Modify field, for the following reasons:
1. Is there a constraint on the field?
2. is the field value self-increasing?
3, is the table used, or is the association trigger?
In DB2, inserting the data process, the increase of the field is apt to appear recessive problem:
| The code is as follows |
Copy Code |
|
INSERT into LGLK. T_uum_dept (UUID, Dept_no, Dept_name, parent_id, IsLeaf, STATUS, Cjzid, Cjzssbmid, CJSJ) VALUES (' 402881f03e11768c013e118 7f22e0002 ', ' 402881f03e11768c013e1187f22e0003 ', ' Hangzhou Xia Cheng District Brigade ', ' 402881ea3d8ba15e013d8ba5b6370004 ',
' 1 ', ' 1 ', ' 402881e63d778f3b013d779029600001 ', ' 402881ea3d8ba15e013d8ba4ed7d0002 ', current timestamp); |
If the first UUID field is the primary key, each insertion must be different, and unlike the original, the insertion fails, and if the field values are associated, the field values must be the same, otherwise there are hidden errors, such as the value of the UUID and the value of the dept_no.
| The code is as follows |
Copy Code |
|
In DB2, UPDATE |
To modify the data type of a field:
| The code is as follows |
Copy Code |
Update student Set usersetateid= (select Usertstateid where userstate= ' activity ') where studentid= ' Sutdentid ' of selected rows
|
Suppose A, b two tables:
| The code is as follows |
Copy Code |
|
UPDATE A
SET a1= (SELECT B1 from B WHERE a.id = b.id) |
Indicates that you want to update the A1 field for all rows of table A: The row that satisfies the where a.id = b.ID is updated a1=b1, and the A1 is updated for the row that does not meet the change criteria.