CLP commands

This application is a simple Command Line Processor (CLP) for working with DB2 Everyplace tables and data. Application developers can directly execute SQL statements from this command line interface. For example:

SELECT * FROM PHONEBOOK

On some platforms, each statement must end in a semicolon. For example:

SELECT * FROM PHONEBOOK;

The Command Line Processor also supports some extended commands.

$file [input file] [output file]
Executes SQL statements from an input file, and writes the result to an output file. This command is not supported on Palm OS, Symbian OS, or Windows CE. For all other platforms, you can specify the full path.

AUTOCOMMIT OFF|ON
Changes the transaction mode to autocommit (the default for the DB2 engine). AUTOCOMMIT OFF changes the transaction mode to manual. Applications can either roll back or commit work.

BLASTDB
Drops all user tables in the database.

COMMIT WORK (or COMMIT)
Commits all previous update, delete, insert operation, and starts a new transaction scope.

CONNECT TO arg1

where arg1 is the database path

Automatically disconnects the application from the current connection and reconnects the application to a local database. The specification is in the SQLConnect() CLI call. The delimiter for the paths for CLI-SQLConnect is either \ (backslash) or / (slash). Both delimiters are understood on all platforms and mapped to the appropriate delimiter when the file system is accessed, thus allowing databases to reside in different directories. For example,

connect to c:\temp \
create table t (a int)
insert into t values (10)
select *from t 

CONNECT TO arg1 USER arg2 USING arg3

where

arg1
database path

arg2
user

arg3
password

Automatically disconnects the application from the current connection and reconnects the application to a local database using the provided user name and password. This information is needed for accessing and operating encrypted tables.

Usage note: A directory name can include a space. For example, C:\System\program files\ is a valid directory structure, but you must use the same directory structure that exists on your machine.

DESCRIBE SELECT
Describe the type, column, and name length of the data returned by a SELECT statement. For example:
DESCRIBE SELECT * FROM PHONEBOOK

DISABLE APPLICATION SET DIRTY
Disables setting dirty bit by the Command Line Processor.

DISABLE LONG FILENAME
Creates files in 8.3 file name format.

DISABLE PHYSICAL DELETE
Disables physical delete mode (default).

DISABLE READ DELETED
Disables reading deleted rows.

DISABLE REORG
Disables table reorganization.

ENABLE APPLICATION SET DIRTY
Enables setting dirty bit by the Command Line Processor.

ENABLE LONG FILENAME
Creates files in long file name format (default).

ENABLE PHYSICAL DELETE
Enables physical delete mode. Deleted rows will no longer be readable.

ENABLE READ DELETED
Enables reading deleted rows.

ENABLE REORG
Enables table reorganization automatically (default).

HELP
Lists all available commands.

LIST COLUMNS
List all user table columns in the database.

LIST INDEX
List all indexes created on a specified table.

LIST TABLES
List all user tables in the database.

ROLLBACK WORK (or ROLLBACK)
Rolls back all previous update, delete, insert operations, and starts a new transaction scope.

VERSION
Prints the DB2 Everyplace Database version string. It returns the same string as the SQLGetInfo() function.

Related tasks

Related concepts