CLPPLUS command
Starts the command line processor plus (CLPPlus) session. After you start the CLPPlus session, you can issue CLPPlus commands, connect to databases, define, and run SQL statements and database commands, and run scripts that contain SQL statements and commands.
Invocation
You must run the CLPPLUS command from the operating system command prompt.
Authorization
None
Required connection
None
Command Syntax
Command parameters
- -verbose
- Sets verbose on. When verbose is set on all CLPPlus messages are printed to the console.
- -nw
- Specifies that the CLPPlus session is started in the current command-line window.
- -s | -si | -sil | -sile | -silen | -silent
- Suppresses the version information, copyright information, prompt messages, command echo, and connection information from being printed in the current CLPPlus session. During silent mode, by default, ECHO is set to OFF. Any attempt to set ECHO to ON is ignored.
- /
- Specifies the current operating system login user ID is used to connect to the database.
- user
- Specifies the user ID to connect to the database.
- password
- Specifies the password that corresponds to the user ID.
- hostname
- Specifies the name of the computer on which the database is located. For example, for a computer that is named ascender, specify @ascender.
- port
- Specifies the port number that receives connections on the computer where the database server is installed. The default is 50000.
- database
- Specifies the database name to which the connection is made. The default is SAMPLE.
- dsn_alias
- Specifies that the database connection information is picked up
from the IBM® data server driver
configuration file (
db2dsdriver.cfg
) from the dsn with alias name dsn_alias. If the specified dsn_alias is not found in the IBM data server driver configuration file, the string dsn_alias is used as a database name and all other connection parameters are obtained interactively. - script-name
- Specifies the name of a script file. If the file is not in the current working directory, you must also include the fully qualified path to the location of the file. The script file can contain SQL statements that are automatically run after you start the CLPPlus session and establish a database connection.
Example
The following examples show how you can use the CLPPLUS command to start the CLPPlus session and optionally connect to databases.The following command starts the CLPPlus
session in client mode:
clpplus
No database connection is attempted. You can issue the CONNECT CLPPlus command to connect to a database.
The following command starts the CLPPlus session and attempts to connect to a
database named SAMPLE on a local host with user ID adminuser and port number
50000:
clpplus adminuser@localhost:50000/sample
The following command
starts the CLPPlus session and prompts for a password for the user ID adminuser. If the password is
valid, the CLPPlus interface attempts to connect to a database named SAMPLE, which is the default
database name.
clpplus adminuser
The following command starts the
CLPPlus session and attempts to connect to a database named SAMPLE with user ID adminuser and
password mypassw0rd. If the user ID and password are valid, a database connection is established.
The drawback to specifying a password is that the password is displayed on the
screen.
clpplus adminuser/mypassw0rd
The following command starts the
CLPPlus session and attempts to connect to a database named SAMPLE on the remote machine ascender
using port 50000, user ID adminuser, and
password mypassw0rd. If these values are valid, a database connection is
established.
clpplus adminuser/mypassw0rd@ascender:50000/sample
The
following command starts the CLPPlus session and attempts to connect to a database named DB on the
local computer with user ID adminuser, password mypassw0rd, and the default port number, which is
50000:
clpplus adminuser/mypassw0rd@localhost/db
The following command
starts the CLPPlus session and attempts to connect to a database by first locating an IBM data server driver configuration file. If one is found, the
default_dsn is read for the host, port, and database values. The current logon ID is used in the
connection attempt. If no IBM data server driver configuration
file is found, all required parameters are requested
interactively.
clpplus /
The following command starts the CLPPlus
session and attempts to connect to a database by first locating an IBM data server driver configuration file. If one is found, the default_dsn is read for the
host, port, and database values. The adminuser ID is used in the connection attempt. If no IBM data server driver configuration file is found, all required
parameters are requested interactively.
clpplus adminuser
The following
command starts the CLPPlus session and attempts to connect to a database by fetching the parameters
from the data_dsn alias in the IBM data server driver
configuration file. Since no user ID is specified, the current logon user ID is used. Any parameters
that cannot be read are requested interactively.
clpplus /@data_dsn
The
following command starts the CLPPlus session and attempts to connect to a database by fetching the
parameters from the data_dsn alias in the IBM data server
driver configuration file. The adminuser user ID is used in the connection. Any parameters that
cannot be read are requested interactively.
clpplus adminuser@data_dsn