Q and A

Asked and Answered

Q. What exactly do the terms plan and package mean in a DB2 UDB for Linux, Unix, and Windows context? Is it possible to run an application with only a package?

Roger Sanders responds:

Each SQL statement must go through the DB2 optimizer before it can be executed. The optimizer generates a data access plan (which is used to locate the data when a query is executed), and the access plan is stored in a package. The package itself is stored in the system catalog if the SQL statement is a static statement coded in an application, or in the package cache, if the SQL statement is a dynamic statement.

You can view the access plan for one or more SQL statements with Explain. It's possible to run an embedded SQL application using only the package. When you precompile the application, a package is created containing access plans for the SQL statements coded in the application. That package is stored in the database that was used to precompile the application. You can also precompile an application and have the access plan information stored in an external file, which can then be bound to any database you want to use the application with; the binding process generates the package and stores it in the database specified — this is referred to a deferred binding.)

For more information, look at the PRECOMPILE and BIND commands in the DB2 Command Reference.

To find out how plans and packages work in DB2 UDB for z/OS or OS/390, read "Programs and Packages, Plans and Collections" by Robert Catterall.


See a complete archive of reader/author Q&As .

CAREER CENTER
Ready to take that job and shove it?
SEARCH JOBS
RECENT JOB POSTINGS
CAREER NEWS
10 Search Engines You Don't Know About
Go beyond Google and get vertical. These specialized search sites will help you find the business information you need -- fast.

Subscribe to the new digital version of IBM Database Magazine
New Digital Version

Sponsored links:



Subscribe to the IBM Database Magazine Newsletter

Email Address *
First Name
Last Name
HTML Preference
HTML Text
 

Fields with * are required.

 




Visit these other IBM and TechWeb Partner Sites: :
Maximizing ROI Through Business Process Management (BPM) and Service-Oriented Architecture (SOA)
Internet Evolution – The Macrosite for News, Analysis, & Opinion About the Future of the Internet
Business Innovation – Technology Strategies and Solutions for Driving Business Success


:: IBM Database Magazine ::