Book Conventions

As you read this book, it will be useful to be aware of the conventions, styles, and structure used throughout.

Syntax Description

All SQL syntax diagrams throughout this book follow style that is consistent with DB2's official product documentation. The syntax diagrams are all read from left to right and top to bottom following the path of each line.

The >>--- symbol indicates the beginning of a syntax diagram.

The ---> symbol indicates that the syntax is continued on the next line.

The >--- symbol indicates that the syntax is continued from the previous line.

The -->< symbol indicates the end of a syntax diagram.

Syntax fragments start with the |--- symbol and end with the ---| symbol.

Required items appear on the horizontal line (the main path).


Optional items appear below the main path.

 >>-required_item--+---------------+----------------------------><                   '-optional_item-' 

If an optional item appears above the main path, that item has no effect on execution, and is used only for readability and or backward-version compatibility.

                   .-optional_item-. >>-required_item--+---------------+---------------------------->< 

If you can choose from two or more items, they appear in a stack.

If you must choose one of the items, one item of the stack appears on the main path.

 >>-required_item--+-required_choice1-+-------------------------><                   '-required_choice2-' 

If choosing one of the items is optional, the entire stack appears below the main path.

 >>-required_item--+------------------+-------------------------><                   +-optional_choice1-+                   '-optional_choice2-' 

If one of the items is the default, it appears above the main path, and the remaining choices are shown below.

                   .-default_choice--. >>-required_item--+-----------------+--------------------------><                   +-optional_choice-+                   '-optional_choice-' 

An arrow returning to the left, above the main line, indicates an item that can be repeated. In this case, repeated items must be separated by one or more blanks.

                   .-----------------.                   V                 | >>-required_item----repeatable_item-+-------------------------->< 

If the repeat arrow contains a comma, you must separate repeated items with a comma.

                   .-,---------------.                   V                 | >>-required_item----repeatable_item-+-------------------------->< 

A repeat arrow above a stack indicates that you can make more than one choice from the stacked items or repeat a single choice.

Keywords appear in uppercase (for example, FROM). They must be spelled exactly as shown. Variables appear in lowercase (for example, column-name). They represent user-supplied names or values in the syntax.

If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax.

Sometimes a single variable represents a larger fragment of the syntax. For example, in the following diagram, the variable parameter-block represents the whole syntax fragment that is labeled parameter-block:

 >>-required_item--| parameter-block |-------------------------->< parameter-block: |--+-parameter1-----------------+-------------------------------|    '-parameter2--+-parameter3-+-'                  '-parameter4-' 

Adjacent segments occurring between large bullets (*) may be specified in any sequence.


The previous diagram shows that item2 and item3 may be specified in either order. Both of the following are valid:

 required_item item1 item2 item3 item4 required_item item1 item3 item2 item4 

All DB2 tokens appear in uppercase and variable names in italic.

A common naming convention is used throughout the guide for all the examples. You are not required to label your variables this way, but it will make debugging and maintaining your code easier.

 p_parameterName: SQL procedure input and output parameters v_parameterName: SQL variables c_cursorName: Cursors 

Meanings of Style

A number of different styles are used to indicate items of interest throughout the guide.


 CREATE PROCEDURE intro1 (OUT p_output INT) LANGUAGE SQL BEGIN     SET p_output = 1; END 


This sidebar indicates a useful tip in the context of the current topic.


This sidebar indicates a note to draw attention to important information.

Book Structure

Each successive chapter in the book is designed to be a prerequisite for the chapters that follow it. At the beginning of every chapter is a summary of the terms and subjects that will be covered. The summary allows experienced users to check whether they already understand the material that will be covered in the chapter.

Contacting the Authors

We are always looking for any feedback that you have both about this book and about DB2 SQL procedures. Please contact us with your opinions and inquiries at 

Depending on the volume of inquires, we may be unable to respond to every technical question but we'll do our best.

The DB2 newsgroup at is another great way to get assistance from IBM employees and the DB2 user community.

Finally, for the latest information on this book, including updates and errata, be sure to visit 

Have fun!

    DB2 SQL PL. Deployment and Advanced Configuration Essential Guide for DB2 UDB on Linux., UNIX, Windows, i5. OS, z. OS
    Intelligent Enterprises of the 21st Century
    ISBN: N/A
    EAN: 2147483647
    Year: 2003
    Pages: 205 © 2008-2017.
    If you may any questions please contact us: