AddExcludedObject Stored Procedure | Application Programming Reference | Vantage - 17.10 - AddExcludedObject - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Application Programming Reference

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Specifies one or more objects whose statistics are to be permanently excluded from the Automate, Analyzer, and Collect-related operations.


  OUT NumAdded    INTEGER

Syntax Elements

Name of the database. DatabaseName identifies the excluded database or the database containing the excluded table.
Name of the table within the specified DatabaseName. TableName identifies the table to exclude within DatabaseName.
Number of objects excluded.

Usage Notes

When you exclude objects by AddExcludedObject, it supersedes any argument values specified in calls to Automate, Analyze, and Collect-related APIs and allows Automate, Analyze, and Collect-related APIs to be called in an "everything but" manner.

Exclusion is not applicable to the TruncateAnalyzerHistory, TruncateAutomateHistory, and TruncateCollectHistory external stored procedures. Rows corresponding to any excluded objects are still deleted as part of the truncation operation assuming they qualify based on the scope of the specified input parameters. For more information about these external stored procedures, see DBAControl Open APIs for Managing Space.

Excluding Statistics

To exclude all ... You must specify a value for ...
statistics for a particular table DatabaseName and TableName.
objects and their statistics within a particular database DatabaseName only.

Example: Using AddExcludedObject

The following example shows how to exclude the table named Project and automate all statistics from the Personnel database, except those on the Project table.

CALL TDSTATS.AddExcludedObject('Personnel','Project', NumAdded);
*** Procedure has been executed.
 *** Total elapsed time was 1 second.
CALL TDSTATS.AutomateStats ('Personnel', NULL, NULL, NULL,'Y','N', AutomateId, NumCopied, NumRemoved);
*** Procedure has been executed.
 *** Total elapsed time was 1 second.
 AutomateId    NumCopied   NumRemoved
-----------  -----------  -----------
          1            4            0