With WOW Enterprise Edition, by default when WOW returns data from the database it allows a user to update the data directly from the running application. In the screenshot below we have a simple SQL operation showing all fields from a customer database. Once the data is returned, there is an edit icon that will open up a details screen allowing any change to be made as shown below.
The user has to enter any changes required and click update to change the information in the database.
WOW Enterprise allows you to control which fields are editable or read only by adjusting the field descriptor. Additional validation checks can be performed using custom Java row subclasses.
WOW will only update the fields you included in the SELECT statement and ONLY if the values changed for a given field. Always make sure the unique key fields are included in the selected fields. So for example:
Select a,b,c, keyfield from myLib.myFile
Let's say on the update screen, you only change the contents of field "C", wow will generate the sql as follows:
update mylib.myFile set c = 'New value' where keyfield = 'valueFromSelect'
This provides the value of NOT overwritting changes to the file that may have been done by other users.
Allowing an end user to edit or insert, or delete database rows, can be enable or disabled by editing the WOW Operation as shown below.
[EE] The UPDATE statement is used to change data in a table. Using the UPDATE statement allows you to
change the value of one or more columns in each row of the table. The screen shot below shows an example
of an UPDATE statement. Previous knowledge of SQL and familiarity with the UPDATE statement is recommended.
The SQL statement in the Operation Code:
UPDATE PJDATA.EMPLOYEE SET BONUS = BONUS + 200
This is a simple SQL query that is updating (giving a raise to) all employees. The basic syntax of an UPDATE
statement is listed above. The UPDATE keyword is directly followed by the name of the table to be updated.
In this case it’s the EMPLOYEE table in the PJDATA schema. The SET clause names the columns you want to
be updated and provides a value for you to update. The bonus for all employees is 200 dollars. The new value
for bonus will then be the old value plus 200 more.