15.10 - DEFAULT DATABASE = database_name - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

Name of the default database established each time a user with this profile logs onto the Teradata Database.

database_name should be an existing database. The system returns an error when a user with this profile tries to create or reference an object within a nonexistent database.

If the default database is NULL or is not defined in the profile assigned to a user, Teradata Database uses the setting defined for the individual user. If a default database is not specified for the profile or user, the system uses the username as the default database.

A user can also use SET SESSION DATABASE to specify an alternate default database.

Example: Creating a Profile that Defines the Default Database

The following request creates a profile called human_resources that defines the default database to be personnel.

    CREATE PROFILE human_resources AS 
      DEFAULT DATABASE = personnel;

The following request assigns the human_resources profile to a new user.

    CREATE USER marks AS 
      PROFILE = human_resources;