15.00 - DATABASE - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)
Last Update
2018-09-24

DATABASE

Purpose  

Returns the name of the default database for the current user.

Syntax  

ANSI Compliance

This is a Teradata extension to the ANSI SQL:2011 standard.

Result Type and Attributes

The data type, format, and title for DATABASE are as follows:

 

Data Type

Format

Title

VARCHAR(30) CHARACTER SET UNICODE

X(30)

Database

Usage Notes  

If a DATABASE request has changed the current default database, then the DATABASE function returns the new name of the default.

Example  

The following statement requests the name of the default database:

   SELECT DATABASE;

The system responds with something like the following:

   Database
   ------------------------------
   Customer_Service