IdentifyDatabase - Teradata Database - Teradata Vantage NewSQL Engine

Application Programming Reference

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-02
dita:mapPath
vwf1492987142269.ditamap
dita:ditavalPath
changebar_rev_16_20_exclude_audience_ie.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Returns the name of the specified database ID.

Definition

REPLACE FUNCTION SYSLIB.IdentifyDatabase
   (DatabaseId  INTEGER
   )
  RETURNS VARCHAR(128) CHARACTER SET UNICODE
          .
          .
          .
;

Input Parameter

Parameter Description
DatabaseId Database ID.

Usage Notes - IdentifyDatabase

The IdentifyDatabase function provides similar functionality to the PMPC IDENTIFY DATABASE request. For information about this interface, see IDENTIFY.

Return Value

This function returns the name of the database.

Example: Using IdentifyDatabase

SELECT IdentifyUser(blk1userid) as "blocking user",
    IdentifyTable(blk1objtid) as "blocking table",
    IdentifyDatabase(blk1objdbid) as "blocking db"
FROM TABLE (MonitorSession(-1,'*',0)) AS t1
WHERE Blk1UserId > 0;
 *** Query completed. One row found. 3 columns returned.
 *** Total elapsed time was 4 seconds.
blocking user               blocking table             blocking db
--------------------------- -------------------------- -------------
user1                       skewAmp1                   DBaaa