Introduction to DB2 for z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


Ways to modify data

Introduction to DB2 for z/OS

Start of changeYou can use SQL statements to add, modify, merge, and remove data in existing tables. You can use the INSERT, UPDATE, MERGE, TRUNCATE, and DELETE statements to manipulate DB2® data.End of change

If you insert, update, merge, or delete data, you can retrieve the data immediately. If you open a cursor and then modify data, you see the modified data only in some circumstances.

Any modifications must maintain the integrity of table relationships. DB2 ensures that an insert, update, or delete operation does not violate any referential constraint or check constraint that is defined on a table.

Before modifying data in your tables, create duplicate tables for testing purposes so that the original table data remains intact. Assume that you created two new tables, NEWDEPT and NEWEMP, that duplicate the DEPT and EMP tables.





Copyright IBM Corporation 1990, 2010