15.10 - AddObjectListEntry - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

Adds a database or table name to an existing named object list.

REPLACE PROCEDURE TDSTATS.AddObjectListEntry(
   IN ObjectListName VARCHAR(128) CHARACTER SET UNICODE,
   IN ObjectListId  BIGINT,
   IN DatabaseName VARCHAR(128) CHARACTER SET UNICODE,
   IN ObjectName VARCHAR(128) CHARACTER SET UNICODE)
           .
           .
           .
;
 

Parameter

Description

ObjectListName

Name of the existing object list.

An object list may contain a mixture of databases and individual tables.

ObjectListId

ID of the existing object list.

DatabaseName

Name of the database containing the objects being added.

This input parameter may contain wildcard characters (%, _). For more information about wildcard characters, see “Usage Notes.”

Note: This input parameter cannot be NULL.

ObjectName

Name of the table to be added.

If you specify NULL, all objects defined in the DatabaseName are added to the list.

If you specify a value other than NULL, you must define the ObjectName within DatabaseName.

This input parameter may contain wildcard characters (%, _). For more information about wildcard characters, see “Usage Notes.”

You must specify ObjectListName or ObjectListId to identify the list previously created via a call to CreateObjectList. For details, see “CreateObjectList” on page 603.

Object list data can be viewed in the TDSTATS.ObjectList and TDSTATS.ObjectListEntry tables. The names of the object lists are stored in the TDSTATS.ObjectList.ListName column.

The SQL DROP DATABASE, DROP TABLE, MODIFY DATABASE, and ALTER TABLE statements will not have their actions automatically reflected in the TDSTATS.ObjectListEntry table. For more information about these SQL statements, see SQL Data Definition Language.

For DatabaseName and ObjectName, wildcard characters are resolved dynamically at the time in which an object list is passed in calling the Automate, Analyze, or PrepCollect APIs. For more information about wildcard characters, see the following topic.

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 SQL Functions, Operators, Expressions, and Predicates.

The following example shows how to create an object list named MyObjects consisting of databases db1, db2.tx, and db3.t%.

CALL TDSTATS.CreateObjectList('MyObjects',ObjectListId);
CALL TDSTATS.AddObjectListEntry('MyObjects',NULL,'db1',NULL);
CALL TDSTATS.AddObjectListEntry('MyObjects',NULL,'db2','tx');
CALL TDSTATS.AddObjectListEntry('MyObjects',NULL,'db3','t%');