Modify data in your database

The following statements modify data:
  • DELETE
  • INSERT
  • MERGE
  • UPDATE

Although these SQL statements are relatively simple when compared with the more advanced SELECT statements, use them carefully because they change the contents of the database.

Think about what happens if the system hardware or software fails during a query. Even if the effect on the application is severe, the database itself is unharmed. However, if the system fails while a modification is under way, the state of the database is in doubt. Obviously, a database in an uncertain state has far-reaching implications. Before you delete, insert, or update rows in a database, ask yourself the following questions:
  • Is user access to the database and its tables secure; that is, are specific users given limited database and table-level privileges?
  • Does the modified data preserve the existing integrity of the database?
  • Are systems in place that make the database relatively immune to external events that might cause system or hardware failures?

If you cannot answer yes to each of these questions, do not panic. Solutions to all these problems are built into the HCL® OneDB® database servers. After a description of the statements that modify data, this section discusses these solutions. The HCL OneDB Database Design and Implementation Guide covers these topics in greater detail.