CREATE DATABASE in CLPPlus
The CLPPlus interface provides limited support for the CREATE DATABASE command. The CREATE DATABASE command can be used to create database in the Db2® and IBM® Informix® environments.
Restrictions
For the Db2 environment, the
CREATE DATABASE command fails if you are connected to a remote database manager
instance. You must be connected to a local database manager instance. You can specify the
following parameters for the CREATE DATABASE command in the CLPPlus interface:
- The required database-name variable
- The optional CODESET parameter
- The optional TERRITORY parameter
- The optional
PAGESIZE parameterNote: When you create a Db2 database without the pagesize parameter, the default page size for the new database is 32 K.
For IBM Informix, CREATE DATABASE from the CLPPlus interface requires connection credentials, specifically to the sysmaster database. You are prompted for connection credentials if a connection does not exist. For more information about the CREATE DATABASE command in IBM Informix, see http://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_0368.htm
Examples
The following command creates a database that is namedtestdb
:create database testdb;
The following command creates
a database that is named testdb
with a page size of 4 K in the
Db2
environment:create database testdb pagesize 4K;
The following command
creates a database that is named testdb
in the Db2 environment.
The code page set is defined as UTF-8, and the territory is defined as
US.create db testdb using codeset UTF-8 territory US;
The following command creates a database that is named
udttest
in
the IBM
Informix
environment. No previous connection exists, so you are prompted to provide the connection
information.
SQL> create database udttest;
Enter DATABASE NAME [sysmaster]:
Enter HOSTNAME [localhost]: 9.130.34.100
Enter PORT [50000]: 9089
Enter ID: informix
Enter password: **********
DB250000I: The command completed successfully.
In
the following example, the first command connects to an IBM
Informix database. The
second command creates a database that is named
udttest
.SQL> connect Informix/informix123@9.130.34.100:9089/stores
Database Connection Information :
---------------------------------
Hostname = 9.130.34.100
Database server = IDS/NT32 IFX11700
SQL authorization ID = informix
Local database alias = stores
Port = 9089
SQL> create database udttest with log mode ansi ;
DB250000I: The command completed successfully.