How Do I...

Modify database data

Display a result column Tip: Apply before committing No example for this topic Change a query

The container details part provides a convenient way to display data, and it provides a working form that enables users to edit and update data in the database.

Formatting a container details part

You can change the format of a container details part in three ways:

Applying changes to the database

You can also add push buttons to an application for saving or discarding changes that the user makes to the container details part. For example, add two push buttons, Apply and Cancel, to an application. Then, make the following connections:

  1. Connect Apply's clicked event to the apply action of the result table from the multi-row query.
  2. Connect Apply's clicked event to the commitTransaction action of the multi-row query.
  3. Connect Cancel's clicked event to the cancel action of the result table from the multi-row query.
  4. Connect Cancel's clicked event to the rollbackTransaction action of the multi-row query.

After you make the connections in the order shown, select Test to test your visual part.

When you change the rows in the container details part and then apply the changes, VisualAge performs all SQL statements needed to update the rows you changed. Similarly, if you use the newRow or deleteRow actions to insert or delete rows, VisualAge performs the insert and delete SQL statements. If you use the cancel action, VisualAge discards the changes you made.


[ Top of Page | Previous Page | Next Page | Table of Contents ]