Updating statistics when columns change
When there are structural changes to a data source object, for example, when a column is added to a table, you must complete several steps to update the statistics for that object in the federated database catalog.
About this task
About this task
If columns at the data source are added, deleted, or altered, you might notice incorrect results or receive an error message. For example, assume that the nickname EUROSALES refers to the europe table in a Sybase database. If a new column called CZECH is added to the table, the federated database will not be aware of the CZECH column. Queries that reference that column will result in an error message.
Procedure
To update the statistics for that object when column changes occur:
Procedure
- Run the utility on the data source that is equivalent to Db2® RUNSTATS. This will update the statistics stored in the data source catalog.
- Drop the current nickname for the data source object using the DROP NICKNAME statement.
- Re-create the nickname using the CREATE NICKNAME statement.