Handle column unknown error after field is deleted from database table
Hi,
A customer has deleted a field from a table not realizing it had a
relation with some of the reports build in the past. Although the field
is not used in the report, it is retrieved from the database.
Running the report without modifications gives us a dynamic sql error
'column unknown' (using ibx).
Can I somehow remove this field from data views automatically after a
report template is loaded? This would be a huge help.
Kind regards,
Jeroen Röttink
JR-soft software solutions
A customer has deleted a field from a table not realizing it had a
relation with some of the reports build in the past. Although the field
is not used in the report, it is retrieved from the database.
Running the report without modifications gives us a dynamic sql error
'column unknown' (using ibx).
Can I somehow remove this field from data views automatically after a
report template is loaded? This would be a huge help.
Kind regards,
Jeroen Röttink
JR-soft software solutions
This discussion has been closed.
Comments
You can implement some code for the Report.Template.OnLoadEnd event to
iterate over the QueryDataViews and use SQLBuilder to remove the field from
the SelectFields[ ] list.
1. Here is an rbWiki 'How To' example for iterating over the DataViews
http://www.digital-metaphors.com/rbWiki/DADE/Fundamentals/How_To...Search_Available_Dataviews
2. The RBuilder Help topics for TdaSQLBuilder and its subtopics contain
code examples and there are examples on rbWiki as well. It would be
something like this...
lSQLBuilder := TdaSQLBuilder.Create(myDataPipeline);
lSQLBuilder.SelectFields.Remove(aTableNameOrAlias, aFieldNameOrAlias);
lSQLBuilder.ApplyUpdates;
lSQLBuilder.Free;
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com