Starting working with DB2 on unix:
You have to install dbd2 client software on your unix workstation and reboot it.
You have to source a db2profile file with all necessary environment
You have to catalog properly, for example:
db2 catalog tcpip node xxx remote somer_server server some_port
db2 catalog db some_db at node xxx
db2 connect to some_db
db2 list database directory
db2 catalog db sample at node xxx
db2 connect to sample
db2 "select * from syscat.tables fetch first 5 rows only"
(note the quotes around select - to hide from shell processing)
db2 -tvf myfile.sql - to run many commands from a file. Don't forget to separate SQL statments with ";"
db2 "select char(reviewed_date, ISO) from oe.OE_contact fetch first 10 rows only"
-------------------------------------------------
分享到:
相关推荐
OTL 4.0 supports all versions of Oracle starting with 7.3 (natively via the corresponding version of the OCI), DB2 UDB LUW / zOS (natively via DB2 CLI), MS SQL Server 2005/2008 (natively via SNAC), ...
* Using a Filter or Locate with a TLargeIntField on a TClientDataSet will always fail with the error "Constant is not correct type". (Quality Central 6142 & 3496). * Calling the CancelRange...
- STARTING WITH: 用于模糊匹配字符串。 - ORDER BY: 用于结果排序。 - GROUP BY/HAVING: 用于数据分组和条件筛选。 以及数据的增删改操作: - INSERT: 插入新的数据行到数据库表中。 - UPDATE: 修改已存在的数据...
- **子句的使用**:深入探讨了`WHERE`子句(用于过滤行)、`STARTING WITH`子句(用于模式匹配)、`ORDER BY`子句(排序结果集)、`GROUP BY`子句(分组数据)、`HAVING`子句(过滤分组后的数据)等内容。...
- **STARTING WITH子句**:用于模糊匹配字符串的开头部分。 - **ORDER BY子句**:按照指定的列对结果集排序。 - **GROUP BY子句**:将数据分组,常与聚合函数一起使用。 - **HAVING子句**:对分组后的数据进行过滤。...