db2 create db and table for test
[db2inst1@etlhost ~]$ db2 create db sakag
DB20000I The CREATE DATABASE command completed successfully.
[db2inst1@etlhost ~]$ db2 connect to sakag
Database Connection Information
Database server = DB2/LINUXX8664 11.5.6.0
SQL authorization ID = DB2INST1
Local database alias = SAKAG
[db2inst1@etlhost ~]$ db2 "create table test (id int not null, col1 varchar(100))"
DB20000I The SQL command completed successfully.
[db2inst1@etlhost ~]$ db2 "insert into test values (1, '一行目')"
DB20000I The SQL command completed successfully.
[db2inst1@etlhost ~]$ db2 commit
DB20000I The SQL command completed successfully.
DB20000I The CREATE DATABASE command completed successfully.
[db2inst1@etlhost ~]$ db2 connect to sakag
Database Connection Information
Database server = DB2/LINUXX8664 11.5.6.0
SQL authorization ID = DB2INST1
Local database alias = SAKAG
[db2inst1@etlhost ~]$ db2 "create table test (id int not null, col1 varchar(100))"
DB20000I The SQL command completed successfully.
[db2inst1@etlhost ~]$ db2 "insert into test values (1, '一行目')"
DB20000I The SQL command completed successfully.
[db2inst1@etlhost ~]$ db2 commit
DB20000I The SQL command completed successfully.
[db2inst1@etlhost ~]$ db2 "select * from test"
ID COL1
----------- ----------------------------------------------------------------------------------------------------
1 一行目
1 record(s) selected.
[db2inst1@etlhost ~]$ db2 list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
TEST DB2INST1 T 2024-03-11-21.28.43.673854
1 record(s) selected.
コメント
コメントを投稿