Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1798201
  • 博文数量: 335
  • 博客积分: 4690
  • 博客等级: 上校
  • 技术积分: 4341
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-08 21:38
个人简介

无聊之人--除了技术,还是技术,你懂得

文章分类

全部博文(335)

文章存档

2016年(29)

2015年(18)

2014年(7)

2013年(86)

2012年(90)

2011年(105)

分类: DB2/Informix

2012-05-09 21:48:42

A package contains control structures that DB2 uses when it runs SQL statements.
An application plan relates an application process to a local instance of DB2 and
specifies processing options.
Packages are produced during program preparation. You can think of the control
structures as the bound or operational form of SQL statements. All control
structures in a package are derived from the SQL statements that are embedded
a single source program.
An application plan contains one or both of the following elements:
 A list of package names
 The bound form of SQL statements
Most DB2 applications require an application plan. Packages make application
programs more flexible and easier to maintain. For example, when you use
packages, you do not need to bind the entire plan again when you change one
SQL statement.

Bind Before your DB2 application can run, you must use the BIND command to
bind the DBRM to a plan or package. For example, you might decide to
put certain SQL statements together in the same program in order to
precompile them into the same DBRM and then bind them into a single
package. When the program runs, DB2 uses a timestamp to verify that the
program matches the correct plan or package.
A plan can contain DBRMs, a package list that specifies packages or
collections of packages, or a combination of DBRMs and a package list.
The plan must contain at least one package or at least one directly bound
DBRM. Each package that you bind can contain only one DBRM.
A collection is a group of associated packages. Binding packages into
package collections allows you to add packages to an existing application
plan without needing to bind the entire plan again. If you include a
collection name in the package list when you bind a plan, any package that
is in the collection becomes available to the plan. The collection can even
be empty when you first bind the plan. Later, you can add packages to the
collection and drop or replace existing packages without binding the plan
again.
The CURRENT PACKAGE PATH special register specifies a value that
identifies a list of collections that DB2 uses when resolving references to
packages that you use to run SQL statements.




阅读(1604) | 评论(0) | 转发(0) |
0

上一篇:数据库笔记(2)

下一篇:EXPLAIN-PLAN_TABLE

给主人留下些什么吧!~~