In WOW many of the SQL statements are generated for the user. For example when selecting records from a field and then clicking Insert, the SQL is dynamically generated. If there are many records, you may come across a problem where WOW will Select, Delete, Insert, Update more than the one record desired because it does not have the appropriate key position(s) set.
The key position is the same as a primary key in a database system and similar to a unique key. It gives the database a reference to differentiate rows (records). Normally, if a primary key is set in database system WOW will pick it up. If not, or if the key position(s) was not set in the database, then it is necessary to set the Key Position in the Field Descriptor to differentiate the rows. Running a WOW application from the builder will allow you to open the FD manager for the field you wish to set as "key field".
Scroll down to the Database Settings section within the FD manager and enter the number 1 in the Key Position field.
Now, when re-running the application, you can see product code is the key position. This must always be a unique number in the database.
If there is no specific field such as ID or employee number use multiple fields that guarantee unique records. In this case set key position for different fields to 1,2,3…etc.
NOTE: These key fields do not need to be shown. They just need to be set. You can set them to not display by changing the display property group of the operation.
TAGS: primary key, primary field