- Ricardo Jasso
- PowerBuilder
- Monday, 11 March 2019 04:10 PM UTC
Hi All,
Recently, I changed my practice of using "Key and Updatable Columns" to "Key and Modified Columns" in the "Where Clause for Update/Delete" of data entry DataWindows. My reasoning is that it is not necessary to include all updatable columns in the where clause, just the ones that got modified. This approach allows other users to modify other fields of the same record without getting concurrency errors.
But since my Data Source query includes additional tables, PowerBuilder includes the columns from the other tables in the update where clause, if they where also modified. The result is an error from the database indicating that such columns are invalid. PowerBuilder should not have included those columns since they don't belong to the table that will get updated even though they were modified.
The reason I am including more tables in the data source and modifying columns from those tables is because I use those tables as reference tables to get values like customer name, etc. This way I can use the same datawindow to add/update records and also to read existing ones. The only drawback to this approach is that when a new record is added I must write code to look up the information on all reference tables and place them manually. By doing so, PowerBuilder detects them as modified and includes them in the update where clause for the table I want to insert a new record to.
Is there a way that only the modified columns of the updatable table be included in the where clause?
TIA,
Ricardo Jasso
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.