Connect and Execute DB2 Command
Connect and Execute DB2 Command
issue database manager commands and SQL statements from the command
For example:
=> connect to sample
=> bind sample.bnd
db2 =>
LIST DATABASE DIRECTORY
select name from sysibm.systables
where name like '%ISP%'
connect to xmeta
select
select
select
select
select TABNAME from syscat.tables where tabschema = 'XMETA' and TABNAME LIKE 'S%
'
create database <SAMPLE_DATABASE_1> using codeset UTF-8 territory en
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG
for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => connect to xmeta
= DB2/LINUXX8664 10.5.2
= ROOT
= XMETA
asnqmfmt
asntdiff
asntrc
asntrcbp
asntrep
clpplus
db2
You can
prompt.
db2
db2
db2fopt
db2fs
db2ftok
db2fupdt
db2gcf
db2gdeps
db2genseed
db2symlookup
db2tapemgr
db2tbst
db2tdbmgr
db2top
db2uext2.pe
db2uext2.v2
issue database manager commands and SQL statements from the command
For example:
=> connect to sample
=> bind sample.bnd