How to use "RefreshRecord" for inserting records ?
How to use "RefreshRecord" for inserting records ?
Hello, I would like to know if there is any functionality or some way to show when a Registry is entered without needing to use "Refresh" that takes too long in a large database.
Thankful.
Thankful.
Re: How to use "RefreshRecord" for inserting records ?
Please write in more detail what is the essence of your question and what you mean by the phrase "Registry is entered".
Re: How to use "RefreshRecord" for inserting records ?
I've put together a small project so you can better understand what I need.
It is in Annex.
https://mega.nz/#!Miw3RTpA!De2KgFLO2c67 ... M8wZNt4UKc
It is in Annex.
https://mega.nz/#!Miw3RTpA!De2KgFLO2c67 ... M8wZNt4UKc
Re: How to use "RefreshRecord" for inserting records ?
This behavior is correct: RefreshRecord is designed for actualizes field values for the current record, but not a newly added one.
When calling the RefreshRecord method, the query specified in the SQLRefresh property will be executed. If the SQLRefresh property is empty, IBDAC will automatically generate an SQL query when the RefreshRecord method is executed. If you manually set the SQLRefresh property to the required query, it will be executed when the RefreshRecord method is called.
To get the text of the SQL query sent to the server, when calling the RefreshRecord method, you can use dbMonitor.
To solve your task in your sample, you can replace the code line in your sample
with
When calling the RefreshRecord method, the query specified in the SQLRefresh property will be executed. If the SQLRefresh property is empty, IBDAC will automatically generate an SQL query when the RefreshRecord method is executed. If you manually set the SQLRefresh property to the required query, it will be executed when the RefreshRecord method is called.
To get the text of the SQL query sent to the server, when calling the RefreshRecord method, you can use dbMonitor.
To solve your task in your sample, you can replace the code line in your sample
Code: Select all
IBCQuery2.RefreshRecord;
Code: Select all
IBCQuery2.Last;
IBCQuery2.SQLRefresh.Text: = 'select * from table_test where id =' + IBCQuery1.FieldByName ('id'). AsString;
IBCQuery2.RefreshRecord;
IBCQuery2.SQLRefresh.Text: = '';
Re: How to use "RefreshRecord" for inserting records ?
Hello I did what you said but it did not work.
Try this attached project.
https://mega.nz/#!Ij5FDKiD!uDQPm-_DqGai ... GLXs21_5ig
Do I have to activate any property ?
Try this attached project.
https://mega.nz/#!Ij5FDKiD!uDQPm-_DqGai ... GLXs21_5ig
Do I have to activate any property ?
Re: How to use "RefreshRecord" for inserting records ?
Firebird does not provide the ability to obtain information about changes made in another query without requesting a server. To get the full changes made by other queries, you should use the Refresh method.
We said that the RefreshRecord method is for updating the current record in the dataset. In your sample:
- when there are no rows in your dataset - the call of the RefreshRecord method will not occur, because at the moment the recordset is empty and the current record is missing; - after adding the first record to the first recordset, you can call the Refresh method for the second dataset;
- if the dataset is not empty - the given current record of the second dataset is updated based on the information received after executing the query specified in the SQLRefresh property, but the new record in the second record will not be added.
We said that the RefreshRecord method is for updating the current record in the dataset. In your sample:
- when there are no rows in your dataset - the call of the RefreshRecord method will not occur, because at the moment the recordset is empty and the current record is missing; - after adding the first record to the first recordset, you can call the Refresh method for the second dataset;
- if the dataset is not empty - the given current record of the second dataset is updated based on the information received after executing the query specified in the SQLRefresh property, but the new record in the second record will not be added.
Re: How to use "RefreshRecord" for inserting records ?
the SQLInsert property would not be for this functionality ?
if so how could I use it ?
if so how could I use it ?
Re: How to use "RefreshRecord" for inserting records ?
The SQLInsert property is used to specify the SQL query that will be used when inserting into the current dataset, so its use does not apply to your task solution.
As we already mentioned, Firebird does not provide the possibility of obtaining information about changes made in another query without requesting a server. To get the full changes made by other queries, you should use the Refresh method.
As we already mentioned, Firebird does not provide the possibility of obtaining information about changes made in another query without requesting a server. To get the full changes made by other queries, you should use the Refresh method.
Re: How to use "RefreshRecord" for inserting records ?
Ah, I understand, thank you.
Re: How to use "RefreshRecord" for inserting records ?
Thank you for the interest in our products.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.