7.12. Packages

A package is a database object consisting of executable SQL, including the access path the DB2 optimizer will take to perform the SQL operation.

To explain how a package works, let's review Figure 7.26, which illustrates the preparation of a C application program with embedded SQL.

Figure 7.26. How a package is obtained

In the figure, the C program myprg.sqc contains embedded SQL. Issuing the precompile command (also known as the prep command) with the bindfile option generates two files, the myprg.bnd bind file containing only SQL information and the myprg.c file containing only C code.

The bind file will ...

Get Understanding DB2®: Learning Visually with Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.