Hi!
I have installed new ODAC version (6.50). My previous version was 5.70. I'm working with D7 and Oracle 9.
In my project I have OraSmartQuery -> OraDataSource -> CRDBGrid with SQL like below:
select * from my_table@on_some_server
Update sql are generated automaticly.
In previus ODAC version this dataset was read/write but after upgrade is readonly. ONLY FOR SQL with @some_other_server.
Why?
Link on server wasn't changed.
I have noticed, that I can set SetFieldsReadOnly := false but in this case, when I try to update record I have error message from Oracle Clinet like below:
ORA-00928: no keyword SELECT
I need you help!
Mariusz
Readonly dataset after version upgrade
TSmartQuery component detects the table for each field in the query and sets the ReadOnly flag for fields that do not belong to the updating table.
The last ODAC version uses another way to detect the table for fields. This way supports DB links but in some complicated cases it doesn't work. (It executes the query SELECT * FROM ALL_TAB_COLUMNS@some_server. This query should return information about table fields to make them editable.)
I recommend to set the ExtendedFieldsInfo option to False. In this case the table for fields is detected without any queries (only parsing of your SQL statement is used). In this case there is no need to set the SetFieldsReadOnly option to False.
The last ODAC version uses another way to detect the table for fields. This way supports DB links but in some complicated cases it doesn't work. (It executes the query SELECT * FROM ALL_TAB_COLUMNS@some_server. This query should return information about table fields to make them editable.)
I recommend to set the ExtendedFieldsInfo option to False. In this case the table for fields is detected without any queries (only parsing of your SQL statement is used). In this case there is no need to set the SetFieldsReadOnly option to False.
This is not a bug. ODAC cannot generate correct update SQL statements for any query because Oracle does not provide information about table name for each field. The old way was working for your query but it didn't work for another query.
So you should change the options (when it helps), add a table prefix before the field names in your SQL:
SELECT T.* FROM my_table@some_server T
or fill the SQLInsert, SQLUpdate and SQLDelete properties manually.
So you should change the options (when it helps), add a table prefix before the field names in your SQL:
SELECT T.* FROM my_table@some_server T
or fill the SQLInsert, SQLUpdate and SQLDelete properties manually.