10.12.2012 Views

Application Programming and SQL Guide - Kmlinux

Application Programming and SQL Guide - Kmlinux

Application Programming and SQL Guide - Kmlinux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

Summary of changes to this book<br />

The principal changes to this book are:<br />

v Chapter 1, “Retrieving data,” on page 3 explains how to create <strong>and</strong> use common<br />

table expressions in SELECT, CREATE VIEW, <strong>and</strong> INSERT statements, <strong>and</strong> also<br />

describes how to use common table expressions to create recursive <strong>SQL</strong>.<br />

v Chapter 2, “Working with tables <strong>and</strong> modifying data,” on page 19 explains how to<br />

select column values as you insert rows into a table by using the SELECT from<br />

INSERT statement.<br />

v Chapter 6, “Basics of coding <strong>SQL</strong> in an application program,” on page 73<br />

contains information on how to use:<br />

– Host variable arrays, <strong>and</strong> their indicator arrays, in a multiple-row INSERT<br />

statement (in a C or C++, COBOL, or PL/I program).<br />

– The GET DIAGNOSTICS statement to return diagnostic information about the<br />

last <strong>SQL</strong> statement that was executed (for example, information about input<br />

data errors during the execution of a multiple-row INSERT statement).<br />

v Chapter 7, “Using a cursor to retrieve a set of rows,” on page 99 explains how to<br />

use:<br />

– Static <strong>and</strong> dynamic scrollable cursors.<br />

– A rowset-positioned cursor in a multiple-row FETCH statement (in a C or C++,<br />

COBOL, or PL/I program).<br />

– Positioned updates <strong>and</strong> deletes with a rowset-positioned cursor.<br />

v Chapter 9, “Embedding <strong>SQL</strong> statements in host languages,” on page 135<br />

contains information on how to declare host variable arrays (for C or C++,<br />

COBOL, <strong>and</strong> PL/I) for use with multiple-row INSERT <strong>and</strong> FETCH statements.<br />

v Chapter 10, “Using constraints to maintain data integrity,” on page 251 describes<br />

informational referential constraints (not enforced by DB2), describes referential<br />

constraints on tables with multi-level security with row-level granularity, <strong>and</strong><br />

explains how to maintain referential integrity when using data encryption.<br />

v Chapter 11, “Using DB2-generated values as keys,” on page 261 is a new<br />

chapter that describes the use of ROWID columns for direct row access, identity<br />

columns as parent keys <strong>and</strong> foreign keys, <strong>and</strong> values generated from sequence<br />

objects as keys across multiple tables.<br />

v Chapter 12, “Using triggers for active data,” on page 269 describes interactions<br />

between triggers <strong>and</strong> tables that use multi-level security with row-level<br />

granularity.<br />

v Chapter 21, “Preparing an application program to run,” on page 461 describes<br />

the new <strong>SQL</strong> processing options:<br />

– CCSID, which specifies the CCSID in which the source program is written.<br />

– NEWFUN, which indicates whether to accept the syntax for DB2 Version 8<br />

new functions.<br />

– For C programs, PADNSTR or NOPADNSTR, which indicates whether or not<br />

output host variables that are NUL-terminated strings are padded with blanks.<br />

This chapter also describes how the CURRENT PACKAGE PATH special register<br />

is used in identifying the collection for packages at run time.<br />

v Chapter 24, “Coding dynamic <strong>SQL</strong> in application programs,” on page 543<br />

describes how to use a descriptor when you prepare <strong>and</strong> execute a multiple-row<br />

INSERT statement. This chapter also includes information about how bind option<br />

REOPT(ONCE) affects dynamic <strong>SQL</strong> statements.<br />

© Copyright IBM Corp. 1983, 2004 xxiii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!