Oracle false complex query error
Posted: 03.05.2014, 06:04
I have an Oracle database that contains 2 tables :
- T_ALERT
- T_ALERT_ENVIRONMENT
The first field in both tables is identical : ID (integer)
When I perform this query : select * from SYAL.T_ALERT
then I get the following error : cannot update a complex query with more then one table.
This is obviously not a complex query
(sidenote: I think the "then" in this error message should be "than")
When I debug the code (rev 3115) a little, in TZGenericCachedResolver.DefineTableName :
- for the first field, it returns that field "ID" belongs to table "T_ALERT_ENVIRONMENT" => NOT OK
- for the second field (which is unique for T_ALERT), it finds "T_ALERT" => OK
This then triggers the SCanNotUpdateComplexQuery exception.
The “TableRef.Table” in TZAbstractResultSetMetadata.GetTableColumns contains, correctly, “T_ALERT”
FYI : if I use this query : select * from SYAL.T_ALERT_ENVIRONMENT, then everything executes correctly
- T_ALERT
- T_ALERT_ENVIRONMENT
The first field in both tables is identical : ID (integer)
When I perform this query : select * from SYAL.T_ALERT
then I get the following error : cannot update a complex query with more then one table.
This is obviously not a complex query
(sidenote: I think the "then" in this error message should be "than")
When I debug the code (rev 3115) a little, in TZGenericCachedResolver.DefineTableName :
- for the first field, it returns that field "ID" belongs to table "T_ALERT_ENVIRONMENT" => NOT OK
- for the second field (which is unique for T_ALERT), it finds "T_ALERT" => OK
This then triggers the SCanNotUpdateComplexQuery exception.
The “TableRef.Table” in TZAbstractResultSetMetadata.GetTableColumns contains, correctly, “T_ALERT”
FYI : if I use this query : select * from SYAL.T_ALERT_ENVIRONMENT, then everything executes correctly