AutomateSingleStat Stored Procedure | Application Programming Reference | Teradata Vantage - AutomateSingleStat - Teradata Vantage - Analytics Database

Application Programming Reference

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
qld1628112131956.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ajo1472244909562
lifecycle
latest
Product Category
Teradata Vantageā„¢

Copies the definition of a single specified statistic from the dictionary to the TDSTATS database.

Syntax

REPLACE PROCEDURE TDSTATS.AutomateSingleStat (
  IN DatabaseName VARCHAR(128) CHARACTER SET UNICODE,
  IN TableName    VARCHAR(128) CHARACTER SET UNICODE,
  IN StatsID      INTEGER,
  IN MarkedApproved CHAR(1) CHARACTER SET LATIN,
  OUT AutomateId  BIGINT,
  OUT NumCopied   INTEGER
)
  ...
;

Syntax Elements

DatabaseName
Name of the database in which the statistic exists.
This input parameter cannot be NULL.
This input parameter may contain wildcard characters (%, _). For more information about wildcard characters, see the usage notes.
TableName
Name of the table on which the statistic exists.
This input parameter cannot be NULL.
This input parameter may contain wildcard characters (%, _). For more information about wildcard characters, see the usage notes.
StatsID
Dictionary ID for the statistic as stored in the DBC.StatsTbl.StatsId column.
This input parameter cannot be NULL.
MarkedApproved
Dictionary ID for the statistic as stored in the DBC.StatsTbl.StatsId column.
This input parameter cannot be NULL.
AutomateId
System supplied ID for the history results from this automation.
NumCopied
Possible values:
  • 0 means the copy operation failed.
  • 1 means the copy operation succeeded.

Wildcard Characters

The following table describes the wildcard characters that the names of some databases, tables, and objects contain.
Character Description
% (PERCENT SIGN) Represents any string of zero or more arbitrary characters. Any string of characters is acceptable as a replacement for the percent.
_ (LOW LINE) Represents exactly one arbitrary character. Any single character is acceptable in the position in which the underscore character appears.

For more information on how to use these wildcard characters, see the SQL LIKE clause in Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates, B035-1145.

Example: Using AutomateSingleStat

The following example shows how to automate the statistic defined on Personnel.Employee database whose dictionary assigned DBC.StatsTbl.StatsId column value is 1.

CALL TDSTATS.AutomateSingleStat ('Personnel', 'Employee', 1, 'Y', AutomateId, NumCopied);

Result:

*** Procedure has been executed.
 *** Total elapsed time was 10 seconds.
 AutomateId    NumCopied
-------------  -------------
      2         1