- 浏览: 375844 次
- 性别:
- 来自: 西安
最新评论
-
chenhaifeng5:
...
数据库问题总结 -
xiaoLee:
在2011年这篇文章是相当给力的!
如何成为一个dba -
tiger427:
现在明白了,怪不得文本文件不兼容。原来如此
不同操作系统对文本文件“行结束符”的不同定义 -
xxwinnie:
总结的很全~ 谢谢~
Oracle系统权限的分类 -
dsmagickey:
对DB2连接,没有比这个更清晰的了
关于Java连接db2 的问题
将某个表导出为IXF档:
Sql代码
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM.ixf" OF IXF MESSAGES "aa" SELECT * FROM CSIDDBD3.T_REFERRAL_FORM;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM_FLAG.ixf" OF IXF MESSAGES "bb"
SELECT * FROM CSIDDBD3.T_REFERRAL_FORM_FLAG;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM.ixf" OF IXF MESSAGES "aa" SELECT * FROM CSIDDBD3.T_REFERRAL_FORM;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM_FLAG.ixf" OF IXF MESSAGES "bb"
SELECT * FROM CSIDDBD3.T_REFERRAL_FORM_FLAG;
CONNECT RESET;
2、日期类型(Date)作为查询条件:
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE BEG_DATE > '2007-01-01';
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE BEG_DATE > '2007-01-01';
3、时间类型(TimeStamp)作为查询条件:
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE INPUT_DATE > '2007-01-01 00:00:00';
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE INPUT_DATE > '2007-01-01 00:00:00';
4、取前N条记录
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP FETCH FIRST 1000 ROWS ONLY;
SELECT * FROM CSIDDBD3.T_ID_MSGPOP FETCH FIRST 1000 ROWS ONLY;
5、如何利用表的NOT LOGGED INITIALLY特性清空表中的数据
Sql代码
alter table table_name activate not logged initially with empty table
alter table table_name activate not logged initially with empty table 参考资料
6、批量更新某一查询结果集的第N条到第M条的记录的SQL(DB2)
Sql代码
update tableName b
set b.A=2 ,b.B=current date --B字段为日期类型
where exists (
select 1 from (
select a.id,row_number()over(order by a.id) req --以tableName表的主键id字段进行排序
from tableName a where a.C =22 and a.D=1) c --加上查询结果集的限制条件
where b.id=c.id and c.req>=1 and c.req<=3);--将要更新查询结果集的第1到第3条记录
update tableName b
set b.A=2 ,b.B=current date --B字段为日期类型
where exists (
select 1 from (
select a.id,row_number()over(order by a.id) req --以tableName表的主键id字段进行排序
from tableName a where a.C =22 and a.D=1) c --加上查询结果集的限制条件
where b.id=c.id and c.req>=1 and c.req<=3);--将要更新查询结果集的第1到第3条记录
7、DB2 如何设置最大连接数?
Sql代码
db2 connect to dbname user username using passwd
db2 update db cfg using MAXAPPLS number
db2 connect to dbname user username using passwd
db2 update db cfg using MAXAPPLS number
8、SUBSTR()函数的使用
函数原型:
Sql代码
SUBSTR(string-expression,start,length)
SUBSTR(string-expression,start,length)【 示例】Sample table DSN8810.PROJ contains column PROJNAME, which is defined as VARCHAR(24). Select all rows from that table for which the string in PROJNAME begins with 'W L PROGRAM '.
Sql代码
SELECT * FROM DSN8810.PROJ WHERE SUBSTR(PROJNAME,1,12) = 'W L PROGRAM ';
SELECT * FROM DSN8810.PROJ WHERE SUBSTR(PROJNAME,1,12) = 'W L PROGRAM ';
【示例2】DB2函数substr分析
错误SQL:
Java代码
select pk_invcl from bd_invcl
where length (invclasscode) <= length ('501')
and substr ('501', 1, length (invclasscode)) = invclasscode
order by invclasscode
select pk_invcl from bd_invcl
where length (invclasscode) <= length ('501')
and substr ('501', 1, length (invclasscode)) = invclasscode
order by invclasscode
错误日志:
Xml代码
2007-01-18 19:10:13 SO|java.sql.SQLException: [IBM][CLI Driver][DB2/AIX64] SQL0138N
The second or third argument of the SUBSTR function is out of range. SQLSTATE=22011
2007-01-18 19:10:13 SO|java.sql.SQLException: [IBM][CLI Driver][DB2/AIX64] SQL0138N
The second or third argument of the SUBSTR function is out of range. SQLSTATE=22011
分析:虽然第一个条件已经限制length (invclasscode) <= length ('501') ,但是不满足第一个条件时,DB2第二个条件还会执行。
但是以下SQL却可以执行,并且以下两个SQL返回结果相同
Sql代码
select count(*) from bd_invcl
where substr (invclasscode, 1,length(invclasscode)+2) = invclasscode
select count(*) from bd_invcl
select count(*) from bd_invcl
where substr (invclasscode, 1,length(invclasscode)+2) = invclasscode
select count(*) from bd_invcl
修正后:
Sql代码
select pk_invcl from bd_invcl
where length (invclasscode) < length ('501')
and substr ('501', 1, case
when length (invclasscode)>length ('501')
then length ('501')
else length (invclasscode) end )
= invclasscode order by invclasscode
select pk_invcl from bd_invcl
where length (invclasscode) < length ('501')
and substr ('501', 1, case
when length (invclasscode)>length ('501')
then length ('501')
else length (invclasscode) end )
= invclasscode order by invclasscode
9、自动增长列
A、包含生成列的 DB2 表上的数据移入和移出 — 入门
B、在 DB2 通用数据库中自动生成数值序列
C、DB2自动增长主键的方法。
D、急,DB2 9中自动增长列如何返回(在线等)
《Understanding DB2® Learning Visually with Examples》
7.8.6. Identity Columns
An identity column is a numeric column in a table that automatically generates a unique numeric value in sequence for each row inserted. A unique identifier is often used in applications to identify a specific row. Unlike sequence objects, which we discuss in section 7.16 , Sequences, identity columns are bound to the table they are defined on. There can be only one identity column per table. DB2 can generate the identity column values in two ways.
Generated always : The values are always generated by DB2. Applications are not allowed to provide an explicit value.
Generated by default : The values can be explicitly provided by an application; if no value is given, DB2 generates one. In this case, however, DB2 cannot guarantee the uniqueness of the value generated.
To create an identity column, use the CREATE TABLE statement with the GENERATED clause and make sure it contains the IDENTITY keyword because GENERATED can also be used to generate other values automatically that are not identity columns. Here is an example.
Sql代码
CREATE TABLE product (
productno INTEGER GENERATED ALWAYS AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
CREATE TABLE product (
productno INTEGER GENERATED ALWAYS AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
The column productno is an INTEGER defined as an identity column that is always generated. The value generated will start from 200, and it will be incremented by 1. Let's perform a few INSERT statements and see the results obtained.
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->error SQL0798N
COMMIT;
INSERT INTO product (description) VALUES ('orange'); --->inserts 202,orange
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT ;
The following query shows the final result.
Sql代码
SELECT * FROM product;
PRODUCTNO DESCRIPTION
----------- ------------
200 banana
201 apple
203 plum
SELECT * FROM product;
PRODUCTNO DESCRIPTION
----------- ------------
200 banana
201 apple
203 plum
The first two INSERT statements show that two identity column values were generated: 200 and 201. The third INSERT statement returns an error because you cannot explicitly insert a value for an identity column generated as ALWAYS . After the third INSERT statement, we issue a COMMIT to guarantee these rows are stored in the database. The fourth INSERT statement causes another identity column value, 202, to be generated; however, we issue a ROLLBACK statement right after, so this row is not stored in the database. Note that the final INSERT statement, which inserts the product plum, generates a value of 203, not 202. (COMMIT and ROLLBACK statements are explained in more detail in Chapter 13 , Developing Database Backup and Recovery Solutions.)
NOTE
An identity column value is generated only once. Once the value has been generated, even if a ROLLBACK statement is performed, it will not be generated again.
Now let's review another example, this time creating the same table product with the GENERATED BY DEFAULT clause.
Sql代码
CREATE TABLE product (
productno INTEGER GENERATED BY DEFAULT AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
CREATE TABLE product (
productno INTEGER GENERATED BY DEFAULT AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
Next, we insert a few rows.
Sql代码
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->inserts 300,pear
INSERT INTO product VALUES (201,'orange'); --->inserts 201,orange
COMMIT;
INSERT INTO product (description) VALUES ('papaya'); --->inserts 202,papaya
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT;
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->inserts 300,pear
INSERT INTO product VALUES (201,'orange'); --->inserts 201,orange
COMMIT;
INSERT INTO product (description) VALUES ('papaya'); --->inserts 202,papaya
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT;
The following query shows the final result.
Sql代码
SELECT * FROM product
PRODUCTNO DESCRIPTION
----------- ---------------------
200 banana
201 apple
300 pear
201 orange
203 plum
SELECT * FROM product
PRODUCTNO DESCRIPTION
----------- ---------------------
200 banana
201 apple
300 pear
201 orange
203 plum
The first two INSERT statements show that two identity column values were generated: 200 and 201. For the third and fourth INSERT statements, we explicitly provided the values 300 and 201, respectively, for the identity column. Note that DB2 did not return an error as in the previous example because we defined the identity column as GENERATED BY DEFAULT . After the fourth INSERT statement, we issue a COMMIT to guarantee these rows are stored in the database. The fifth INSERT statement causes another identity column value, 202, to be generated; however, we issue a ROLLBACK statement right after, so this row is not stored in the database. Note that the final INSERT statement, which inserts the product plum, generates a value of 203, not 202.
The following final example illustrates a GENERATED value, which is not an identity column. The example uses GENERATED ALWAYS , but you can also use GENERATED BY DEFAULT .
Sql代码
CREATE TABLE income (
empno INTEGER,
salary INTEGER,
taxRate DECIMAL(5,2),
netSalary DECIMAL(7,2) GENERATED ALWAYS AS (salary * (1 - taxRate))
)
CREATE TABLE income (
empno INTEGER,
salary INTEGER,
taxRate DECIMAL(5,2),
netSalary DECIMAL(7,2) GENERATED ALWAYS AS (salary * (1 - taxRate))
)
If you insert the following row:
Sql代码
INSERT INTO income (empno, salary, taxRate) VALUES (111, 50000, 0.3)
INSERT INTO income (empno, salary, taxRate) VALUES (111, 50000, 0.3)
The result is:
Sql代码
EMPNO SALARY TAXRATE NETSALARY
----------- ----------- ------- ---------
111 50000 0.30 35000.00
EMPNO SALARY TAXRATE NETSALARY
----------- ----------- ------- ---------
111 50000 0.30 35000.00
DB2 generates the value of the last column NETSALARY based on the SALARY and TAXRATE columns.
Sql代码
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM.ixf" OF IXF MESSAGES "aa" SELECT * FROM CSIDDBD3.T_REFERRAL_FORM;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM_FLAG.ixf" OF IXF MESSAGES "bb"
SELECT * FROM CSIDDBD3.T_REFERRAL_FORM_FLAG;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM.ixf" OF IXF MESSAGES "aa" SELECT * FROM CSIDDBD3.T_REFERRAL_FORM;
CONNECT RESET;
CONNECT TO CSI;
EXPORT TO "C:\T_R_FORM_FLAG.ixf" OF IXF MESSAGES "bb"
SELECT * FROM CSIDDBD3.T_REFERRAL_FORM_FLAG;
CONNECT RESET;
2、日期类型(Date)作为查询条件:
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE BEG_DATE > '2007-01-01';
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE BEG_DATE > '2007-01-01';
3、时间类型(TimeStamp)作为查询条件:
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE INPUT_DATE > '2007-01-01 00:00:00';
SELECT * FROM CSIDDBD3.T_ID_MSGPOP WHERE INPUT_DATE > '2007-01-01 00:00:00';
4、取前N条记录
Sql代码
SELECT * FROM CSIDDBD3.T_ID_MSGPOP FETCH FIRST 1000 ROWS ONLY;
SELECT * FROM CSIDDBD3.T_ID_MSGPOP FETCH FIRST 1000 ROWS ONLY;
5、如何利用表的NOT LOGGED INITIALLY特性清空表中的数据
Sql代码
alter table table_name activate not logged initially with empty table
alter table table_name activate not logged initially with empty table 参考资料
6、批量更新某一查询结果集的第N条到第M条的记录的SQL(DB2)
Sql代码
update tableName b
set b.A=2 ,b.B=current date --B字段为日期类型
where exists (
select 1 from (
select a.id,row_number()over(order by a.id) req --以tableName表的主键id字段进行排序
from tableName a where a.C =22 and a.D=1) c --加上查询结果集的限制条件
where b.id=c.id and c.req>=1 and c.req<=3);--将要更新查询结果集的第1到第3条记录
update tableName b
set b.A=2 ,b.B=current date --B字段为日期类型
where exists (
select 1 from (
select a.id,row_number()over(order by a.id) req --以tableName表的主键id字段进行排序
from tableName a where a.C =22 and a.D=1) c --加上查询结果集的限制条件
where b.id=c.id and c.req>=1 and c.req<=3);--将要更新查询结果集的第1到第3条记录
7、DB2 如何设置最大连接数?
Sql代码
db2 connect to dbname user username using passwd
db2 update db cfg using MAXAPPLS number
db2 connect to dbname user username using passwd
db2 update db cfg using MAXAPPLS number
8、SUBSTR()函数的使用
函数原型:
Sql代码
SUBSTR(string-expression,start,length)
SUBSTR(string-expression,start,length)【 示例】Sample table DSN8810.PROJ contains column PROJNAME, which is defined as VARCHAR(24). Select all rows from that table for which the string in PROJNAME begins with 'W L PROGRAM '.
Sql代码
SELECT * FROM DSN8810.PROJ WHERE SUBSTR(PROJNAME,1,12) = 'W L PROGRAM ';
SELECT * FROM DSN8810.PROJ WHERE SUBSTR(PROJNAME,1,12) = 'W L PROGRAM ';
【示例2】DB2函数substr分析
错误SQL:
Java代码
select pk_invcl from bd_invcl
where length (invclasscode) <= length ('501')
and substr ('501', 1, length (invclasscode)) = invclasscode
order by invclasscode
select pk_invcl from bd_invcl
where length (invclasscode) <= length ('501')
and substr ('501', 1, length (invclasscode)) = invclasscode
order by invclasscode
错误日志:
Xml代码
2007-01-18 19:10:13 SO|java.sql.SQLException: [IBM][CLI Driver][DB2/AIX64] SQL0138N
The second or third argument of the SUBSTR function is out of range. SQLSTATE=22011
2007-01-18 19:10:13 SO|java.sql.SQLException: [IBM][CLI Driver][DB2/AIX64] SQL0138N
The second or third argument of the SUBSTR function is out of range. SQLSTATE=22011
分析:虽然第一个条件已经限制length (invclasscode) <= length ('501') ,但是不满足第一个条件时,DB2第二个条件还会执行。
但是以下SQL却可以执行,并且以下两个SQL返回结果相同
Sql代码
select count(*) from bd_invcl
where substr (invclasscode, 1,length(invclasscode)+2) = invclasscode
select count(*) from bd_invcl
select count(*) from bd_invcl
where substr (invclasscode, 1,length(invclasscode)+2) = invclasscode
select count(*) from bd_invcl
修正后:
Sql代码
select pk_invcl from bd_invcl
where length (invclasscode) < length ('501')
and substr ('501', 1, case
when length (invclasscode)>length ('501')
then length ('501')
else length (invclasscode) end )
= invclasscode order by invclasscode
select pk_invcl from bd_invcl
where length (invclasscode) < length ('501')
and substr ('501', 1, case
when length (invclasscode)>length ('501')
then length ('501')
else length (invclasscode) end )
= invclasscode order by invclasscode
9、自动增长列
A、包含生成列的 DB2 表上的数据移入和移出 — 入门
B、在 DB2 通用数据库中自动生成数值序列
C、DB2自动增长主键的方法。
D、急,DB2 9中自动增长列如何返回(在线等)
《Understanding DB2® Learning Visually with Examples》
7.8.6. Identity Columns
An identity column is a numeric column in a table that automatically generates a unique numeric value in sequence for each row inserted. A unique identifier is often used in applications to identify a specific row. Unlike sequence objects, which we discuss in section 7.16 , Sequences, identity columns are bound to the table they are defined on. There can be only one identity column per table. DB2 can generate the identity column values in two ways.
Generated always : The values are always generated by DB2. Applications are not allowed to provide an explicit value.
Generated by default : The values can be explicitly provided by an application; if no value is given, DB2 generates one. In this case, however, DB2 cannot guarantee the uniqueness of the value generated.
To create an identity column, use the CREATE TABLE statement with the GENERATED clause and make sure it contains the IDENTITY keyword because GENERATED can also be used to generate other values automatically that are not identity columns. Here is an example.
Sql代码
CREATE TABLE product (
productno INTEGER GENERATED ALWAYS AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
CREATE TABLE product (
productno INTEGER GENERATED ALWAYS AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
The column productno is an INTEGER defined as an identity column that is always generated. The value generated will start from 200, and it will be incremented by 1. Let's perform a few INSERT statements and see the results obtained.
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->error SQL0798N
COMMIT;
INSERT INTO product (description) VALUES ('orange'); --->inserts 202,orange
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT ;
The following query shows the final result.
Sql代码
SELECT * FROM product;
PRODUCTNO DESCRIPTION
----------- ------------
200 banana
201 apple
203 plum
SELECT * FROM product;
PRODUCTNO DESCRIPTION
----------- ------------
200 banana
201 apple
203 plum
The first two INSERT statements show that two identity column values were generated: 200 and 201. The third INSERT statement returns an error because you cannot explicitly insert a value for an identity column generated as ALWAYS . After the third INSERT statement, we issue a COMMIT to guarantee these rows are stored in the database. The fourth INSERT statement causes another identity column value, 202, to be generated; however, we issue a ROLLBACK statement right after, so this row is not stored in the database. Note that the final INSERT statement, which inserts the product plum, generates a value of 203, not 202. (COMMIT and ROLLBACK statements are explained in more detail in Chapter 13 , Developing Database Backup and Recovery Solutions.)
NOTE
An identity column value is generated only once. Once the value has been generated, even if a ROLLBACK statement is performed, it will not be generated again.
Now let's review another example, this time creating the same table product with the GENERATED BY DEFAULT clause.
Sql代码
CREATE TABLE product (
productno INTEGER GENERATED BY DEFAULT AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
CREATE TABLE product (
productno INTEGER GENERATED BY DEFAULT AS
IDENTITY (START WITH 200 INCREMENT BY 1),
description VARCHAR(50) )
Next, we insert a few rows.
Sql代码
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->inserts 300,pear
INSERT INTO product VALUES (201,'orange'); --->inserts 201,orange
COMMIT;
INSERT INTO product (description) VALUES ('papaya'); --->inserts 202,papaya
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT;
INSERT INTO product VALUES (DEFAULT,'banana'); --->inserts 200,banana
INSERT INTO product (description) VALUES ('apple'); --->inserts 201,apple
INSERT INTO product VALUES (300,'pear'); --->inserts 300,pear
INSERT INTO product VALUES (201,'orange'); --->inserts 201,orange
COMMIT;
INSERT INTO product (description) VALUES ('papaya'); --->inserts 202,papaya
ROLLBACK;
INSERT INTO product (description) VALUES ('plum'); --->inserts 203,plum
COMMIT;
The following query shows the final result.
Sql代码
SELECT * FROM product
PRODUCTNO DESCRIPTION
----------- ---------------------
200 banana
201 apple
300 pear
201 orange
203 plum
SELECT * FROM product
PRODUCTNO DESCRIPTION
----------- ---------------------
200 banana
201 apple
300 pear
201 orange
203 plum
The first two INSERT statements show that two identity column values were generated: 200 and 201. For the third and fourth INSERT statements, we explicitly provided the values 300 and 201, respectively, for the identity column. Note that DB2 did not return an error as in the previous example because we defined the identity column as GENERATED BY DEFAULT . After the fourth INSERT statement, we issue a COMMIT to guarantee these rows are stored in the database. The fifth INSERT statement causes another identity column value, 202, to be generated; however, we issue a ROLLBACK statement right after, so this row is not stored in the database. Note that the final INSERT statement, which inserts the product plum, generates a value of 203, not 202.
The following final example illustrates a GENERATED value, which is not an identity column. The example uses GENERATED ALWAYS , but you can also use GENERATED BY DEFAULT .
Sql代码
CREATE TABLE income (
empno INTEGER,
salary INTEGER,
taxRate DECIMAL(5,2),
netSalary DECIMAL(7,2) GENERATED ALWAYS AS (salary * (1 - taxRate))
)
CREATE TABLE income (
empno INTEGER,
salary INTEGER,
taxRate DECIMAL(5,2),
netSalary DECIMAL(7,2) GENERATED ALWAYS AS (salary * (1 - taxRate))
)
If you insert the following row:
Sql代码
INSERT INTO income (empno, salary, taxRate) VALUES (111, 50000, 0.3)
INSERT INTO income (empno, salary, taxRate) VALUES (111, 50000, 0.3)
The result is:
Sql代码
EMPNO SALARY TAXRATE NETSALARY
----------- ----------- ------- ---------
111 50000 0.30 35000.00
EMPNO SALARY TAXRATE NETSALARY
----------- ----------- ------- ---------
111 50000 0.30 35000.00
DB2 generates the value of the last column NETSALARY based on the SALARY and TAXRATE columns.
发表评论
-
tsm
2010-09-17 21:32 1042http://publib.boulder.ibm.com/t ... -
export lob类型数据
2009-03-23 19:21 1347在导出具有大对象列的表时,只会导出头 32 KB LOB 数据 ... -
指定锁定等待方式策略
2009-03-23 19:17 982单个会话现在可以指定锁定等待方式策略,该策略在会话需要不能立即 ... -
QUIESCE
2009-03-23 18:17 2687解答: 使用新的QUIESCE命令,可以强制所有用户关闭实例 ... -
DB2停止实例下数据库的几种方法
2009-03-23 18:15 30731. db2 connect to sample db2 q ... -
db2学习
2009-03-22 18:53 126首先应该是硬件。 一 ... -
SQL0270N 函数不受支持(原因码 = "2")。 SQLSTATE=4
2009-03-18 10:53 2026根本的原因是数据库是分区的,而建表的时候没有指定分区键,建主 ... -
DB2 日常维护技巧,第 1 部分
2009-03-16 18:28 1445级别: 初级 程永 (cyong@cn.ibm.com), ... -
userexit
2009-03-16 18:26 997userexit - 启用用户出口配置参数 配置类型 数据库 ... -
logretain
2009-03-16 18:24 1932此参数确定是否保留活动日志文件以及这些文件是否可用于前滚恢复。 ... -
数据库问题总结
2009-03-16 18:08 1674我对昨晚数据库升级出现的问题现在总结一下: 下边是错 ... -
db2pd 工具
2009-03-13 15:24 1185DB2 UDB V8.2 带来饿一个强大的工具 db2pd ... -
DB2 V9 新增加的代理程序进程
2009-03-13 13:49 1610随着 DB2 UDB V9 的正式发布,已经有不少用户开始体验 ... -
SQL1611W 监视器不返回任何东西
2009-03-12 20:00 2169原因: 1.实例级别的开关。 ... -
db2 临时表注意事项
2009-03-09 13:36 1436在使用DB2的临时表时, 以下几点需要注意: 1. DB2的 ... -
查看表的行数。
2009-03-05 10:41 1042必须先runstate 一下先 select card fr ... -
SQL30081N
2009-03-04 20:32 1803如果你是远程客户端遇到问题,那么先测试服务器本地是否可以连 ... -
存储过程cursor
2009-02-28 16:36 2138前面我们已经讨论了如何声明存储过程的返回结果集。 ... -
db2 快照
2009-02-28 14:14 1287实例级别 1.db2 update dbm cfg using ... -
db2 生成表的导出脚本
2009-02-28 11:49 2215使用 shell 脚本生成并导出所有数据的 DML 脚本,并 ...
相关推荐
五十四条DB2常用语句集萃
db2常用语句总结(新人必读)
db2常用语句
DB2常用语句
db2常用45条语句,很实用的东东,分享一下
db2常用语句、db2常用语句、db2常用语句、db2常用语句、db2常用语句、db2常用语句、db2常用语句、db2常用语句
db2常用句子.txt
DB2的sql语句、函数使用汇总.各种常用的命令总结
DB2与ORACLE常用语句对照,常用命令,语法格式
db2常用命令的集合,挺不错的,哈哈,保证下了之后可以学到好多东西,哈哈 ,好东西大家共享
很好的东西,使用DB2必备.也可以作平常复习巩固用,免费分享给大家了……
DB2主要应用于大型应用系统,具有较好的可伸缩性,可支持从大型机到单用户环境,应用于所有常见的服务器操作系统平台下。 DB2提供了高层次的数据利用性、完整性、安全性、可恢复性,以及小规模到大规模应用程序的...
由于db2的错误提示信息不是很明显,造成错误难以查询,所以提供这样的文件帮助我们快速解决问题。提供效率
平常操作DB2数据库比较常用的DB2命令、DB2常用的SQL语句等
DB2中常用的SQL语句 经典SQL语句集锦 SQL分类: DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE) DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT) DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)
多年积累的db2 常用操作,覆盖常用语句,批量倒数,配置信息 很实用!
介绍了DB2常用命令,很多基础语句包括创建表,修改表等等
这是实际开发过程中遇到的自己整理的的一些DB2常用的较难的SQL语句
博文链接:https://peng-jian-ming.iteye.com/blog/185790