How to Identify changed records after querying? [message #651229] |
Fri, 13 May 2016 05:25 |
|
adfnewbie
Messages: 54 Registered: January 2016
|
Member |
|
|
Hi friends,
I have a non-DB block with 10 fields out of which 8 are read-only(only for display) and 2 are LOV's which user will select. Question is, how can I know for which record user has changed the value from LOV if there are, say, 100 records displayed on the block.
I have defined a cursor which fetches these 100 records and I am displaying this data row-by-row in this non-db block. After querying this data, user will change some records randomly by selecting from LOV's and hit some save/copy button. How do I identify which records have been changed and needs to be updated in database?
Any suggestions/help is highly appreciated. Thanks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to Identify changed records after querying? [message #651473 is a reply to message #651472] |
Wed, 18 May 2016 10:29 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If it's a DB block then you have to use execute_query to populate it, that's not optional.
You can use selects/cursors for the non-db items but the DB items have to be populated by excute_query, otherwise forms will think the record is a new one and try do an insert.
So use execute_query
|
|
|
|
|
|
|
Re: How to Identify changed records after querying? [message #651479 is a reply to message #651478] |
Wed, 18 May 2016 11:19 |
|
adfnewbie
Messages: 54 Registered: January 2016
|
Member |
|
|
cursor c1 is select a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r from x,y,z where x.a=y.b and y.c=z.d and x.e='123';
This is my query to pull the data. Let's assume it gives me 10 records. User will always work with these 10 records, he cannot create an eleventh one. This data is only for informative purpose. Looking at this data, user will decide for which record he wants to insert/update by making selections from the 2 lov's provided. Problem is, user will not know if that record exists in system or not, it's for me to handle that if a record corresponding to user's selection is available/present in the table, it should simply update, if not, it should create a new one.
|
|
|
|
|