Refresh record not working
Refresh record not working
When calling refresh record (to get fields form joined table) nothing refresh actually happens.
The user is inserting a record in one form and I would like to update the grid view on another form without refreshing the whole dataset (which does work). To be sure I kept the key value and located the record, as well as refreshing the grid in other form.
PS I did try "SmartFetch" but it resulted in an invalid SQL error message.
The user is inserting a record in one form and I would like to update the grid view on another form without refreshing the whole dataset (which does work). To be sure I kept the key value and located the record, as well as refreshing the grid in other form.
PS I did try "SmartFetch" but it resulted in an invalid SQL error message.
Re: Refresh record not working
Hello,
The RefreshRecord method updates the current record in the DataSet. in order for new records inserted externally to be added to the DataSet automatically, you should use the OraChangeNotification component. You can find a sample of working with this component in the ODAC demos.
P.S. Please provide the error message text or a screenshot at using SmartFetch, as well as the query causing the error.
The RefreshRecord method updates the current record in the DataSet. in order for new records inserted externally to be added to the DataSet automatically, you should use the OraChangeNotification component. You can find a sample of working with this component in the ODAC demos.
P.S. Please provide the error message text or a screenshot at using SmartFetch, as well as the query causing the error.
Re: Refresh record not working
The record is already visible in the dataset, the user inserts a record, the key fields of the new record are displayed correctly in the form with the grid. After post/commit I locate the new record in the grid and call RefreshRecord, hoping to update values from other tables, tables joined in a query.
PS. I will have to send this later I don't have access at the moment..
PS. I will have to send this later I don't have access at the moment..
Re: Refresh record not working
The SmartRefresh produces ORA-00933: SQL command not properly ended.
Without SmartRefresh it works fine, normal Refresh as well, RefreshRecord does not give an error, but does not work. I can send you the query in an e-mail, but I cannot post here.
Without SmartRefresh it works fine, normal Refresh as well, RefreshRecord does not give an error, but does not work. I can send you the query in an e-mail, but I cannot post here.
Re: Refresh record not working
If you are using JOIN, you should specify the correct query by yourself to for record update in the SQLRefresh property of this DataSet. By default, a query is generated for one table (the first one in the query).
Re: Refresh record not working
That would not work.
Refresh works fine, but it is a large dataset and I am looking for a way be able to refresh just this record of the query result.
Refresh works fine, but it is a large dataset and I am looking for a way be able to refresh just this record of the query result.
Re: Refresh record not working
The SQLRefresh property is designed for updating one record. For this, SQL must have an update condition with a parameter, to which the unique key will be put for this query. For example, if your main query is like the following:
then the following record update query will be generated automatically:
In the SQLRefresh property, you should set an update query, that will take into account the second table too, i.e.:
O
In this case,when calling RefreshRecord, only one column with the current values of the DEPTNO and EMPNO key fields will be updated.
Code: Select all
SELECT D.DEPTNO, D.DNAME, E.EMPNO, E.ENAME FROM DEPT D, EMP E WHERE D.DEPTNO = E.EMPNO
Code: Select all
SELECT DEPTNO, DNAME FROM DEPT WHERE DEPTNO = :DEPTNO
Code: Select all
SELECT D.DEPTNO, D.DNAME, E.EMPNO, E.ENAME FROM DEPT WHERE D.DEPTNO = E.DEPTNO AND D.DEPTNO = :DEPTNO AND E.EMPNO = :EMPN
In this case,when calling RefreshRecord, only one column with the current values of the DEPTNO and EMPNO key fields will be updated.
Re: Refresh record not working
Thanks, OK my misunderstanding.. I thought that SQL Refresh was used to refresh the dataset as well, and as it worked fine I assumed it would for RefreshRecord..
Re: Refresh record not working
Please provide the text of the query leading to the error in the SmartFetch mode. In addition, please specify the options of the DataSet, whose values differ from the default ones.
Re: Refresh record not working
Can I send the query by an e-mail?
Re: Refresh record not working
You can send the query to alexp*devart*com .