create database argument: Create a database (SQL administration API)

Use the create database argument with the admin() or task() function to create a database.

Syntax


1  EXECUTE FUNCTION
1 admin
1 task
2  ( "create database
1?  with
2.1 log
2.1 buffered log
2.1 log mode ansi
3? 
4.1 nlscase insensitive
4.1 nlscase sensitive
3  "
3  , "database_name"
3?  , "dbspace"?  , "locale"
3  ) ;
Element Description Key Considerations
database_name The name of the database.
dbspace The name of the dbspace to store the data for this database. The default is the root dbspace. The dbspace must already exist on the database server.
locale The locale associated with the database. The values for locale are the same as the values for the DB_LOCALE environment variable.

If you omit this property, the locale is set by the value of the DB_LOCALE environment variable. The default locale is US English.

Usage

This function is equivalent to the CREATE DATABASE statement.

You cannot use this function to create a tenant database. You create a tenant database with the tenant create argument.

Examples

The following example creates the database named demodbs with unbuffered logging:
EXECUTE FUNCTION task("create database with log","demodbs");
     
The following example creates a database that is not case-sensitive named demodbs2 with ANSI compliant logging in the dbspace named dataspace1:
EXECUTE FUNCTION task("create database with log mode ansi nlscase insensitive",
"demodbs2","dataspace1");
			
The following example creates a database named demodbs3 with a French-Canadian locale in the dbspace name dataspace1:
EXECUTE FUNCTION task("create database","demodbs3","dataspace1","fr_ca.8859-1");