Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh record in block 1

Status
Not open for further replies.

carolinaof

Programmer
Oct 1, 2001
26
0
0
BR
Is there a way to show changes in records in a data block in forms, without using execute_query? I want to refresh only the select record. Is there a way to do that?

Thanks in advance for help.
Carol.
 
For a block property, there is a property under 'Advanced Database'. Try changing the value of 'DML Returning Value' to 'Yes'.

regards

ted
 
Sorry, but I can't understand well the problem. However, I think that the text item property "Initial Value" can help you.

Best regards.
 
I have a data block in a form. The record where the cursor is located is changed by a stored procedure called through a button. I want the user to see the changes without re-querying. In other words I want to refresh the current record, not the entire block. Is that clearer?
 
Its not possible to requery a single record in a block without requerying the entire record set.

Is there a reason why you dont want to use execute_query, such as performance?

The way I have set up auto-refreshes is to use DBMS_ALERT and a timer. If a record is refreshed the form performs the following steps:

1) Make a note of the number of record that the cursor is currently on :)SYSTEM.CURSOR_RECORD).
2) If its a multi-row block, make a note of the lowest visible record in the block (TOP_RECORD and RECORDS_DISPLAYED block properties).
3) Re-query using the same WHERE clause as the last query :)SYSTEM.LAST_QUERY).
4) Move the cursor to the lowest displayed record from step 2.
5) Move the cursor to the current record from step 1.

Steps 4 and 5 will ensure the visible display of the records does not appear to move, and any changed records will be automatically displayed as if they were refreshed.
 
Yes, that solution is similar to the one I used. It's performance is not very satisfactory...
 
Form Property -> Isolation Mode = Read Committed
Block (to refresh) Property -> Locking Mode = Delayed

WHEN-BUTTOM-PRESSED
/* This is the refresh buttom */

/* I get the new values of the record and assign them to my block */
SELECT ... from <block_table> ...

SET_RECORD_PROPERTY(<my_record>, <my_block>,STATUS,QUERY_STATUS) ;


Sorry, I haven't had enough time to test it strongly but it seems to work well.

Best Regards.

Enrique.
 
Enrique,

It does seem to work fine. Thanks a lot for you help.

Carol.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top