Powerbuilder ‘Gotcha’ – Datawindow update properties

Posted on Friday, September 17th, 2010 at 8:20 pm in

So a customer is complaining that their data is ‘auto-magically’ changing and there is ‘no way anyone here is doing it since I’m the only one who knows how’. Blah, blah, blah.

Solution? – database trigger to log when something is changed on the specified table.

Now you go to the datawindow object which handles the particular item in question and you look at the update properties and you see something like this:

Notice the Key Modification group box has ‘Use Delete then Insert’ as the option. Now you think that this means that Powerbuilder is going to issue a delete and then an insert statement whenever the table is modified so you go off and write a delete trigger to watch for changes in code or description. Here’s the rub. The ‘Unique Key Column(s) values determine when the delete/insert is performed. In the example, a change to the taskcode would not trigger a delete; it triggers an update. Make you trigger fire on an update and delete if you want to track such things.

Good luck with your customer…

You might also be interested in

Add your comment

Leave a Reply

Top