Cross-Platform DB2 Stored Procedures: Building and Debugging

Cross-Platform DB2 Stored Procedures: Building and Debugging

Cross-Platform DB2 Stored Procedures: Building and Debugging Setting up the environment for DB2 Building DB2 stored procedures Debugging DB2 stored procedures Maria Sueli Almeida Marian Alcazar Paolo Bruni Sabine Kaschta Mark Leung ibm.com/redbooks SG24-5485-01 International Technical Support Organization Cross-Platform DB2 Stored Procedures: Building and Debugging May 2001 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix D, “Special notices” on page 497. Second Edition (May 2001) This edition applies to Version 6 of IBM DATABASE 2 Universal Database Server for OS/390 (DB2 UDB Server for OS/390 Version 6), Program Number 5645-DB2, Version 7 of DB2 UDB for UNIX, Windows, OS/2, IMS Version 6, Release 3 of CICS Transaction Server for OS/390, Program Number 5655-147, and other current versions and releases of IBM products. Make sure you are using the correct edition for the level product. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. QXXE Building 80-E2 650 Harry Road San Jose, California 95120-6099 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1999, 2001. All rights reserved. Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents Figures. .xiii Tables. .xix Preface. .xxi The team that wrote this redbook. xxi Comments welcome. xxiii Part 1. Introduction . 1 Chapter 1. How this book is organized . 3 The content . 3 Part 2. Infrastructure . 5 Chapter 2. The IBM DB2 Stored Procedure Builder . 7 2.1 Overview . 7 2.1.1 What is DB2 SPB? . 7 2.1.2 Programming languages supported . 9 2.2 Product Installation on Windows NT . 10 2.2.1 Prerequisites for SPB . 10 2.2.2 Installing the SPB . 11 2.3 Advanced configuring of the SPB . 11 2.4 Concepts and terminology . 12 2.4.1 Project . 13 2.4.2 Create . 13 2.4.3 Generate . 13 2.4.4 Build . 14 2.4.5 Register . 14 2.4.6 Run . 14 2.4.7 Get source . 14 2.4.8 Modify . 15 2.4.9 Dirty procedures. 15 2.4.10 Database connection . 15 2.5 The SPB components. 15 2.5.1 The stored procedure wizards . 16 2.5.2 The SQL Assistant . 18 2.5.3 Client configuration assistant . 19 2.5.4 IBM Distributed Debugger . 19 2.6 Working with SPB projects . 20 © Copyright IBM Corp. 2001 iii 2.6.1 Creating projects under the SPB . 21 2.6.2 Managing SPB projects . 23 2.7 Using the Stored Procedure Builder . 23 2.7.1 Viewing existing stored procedures . 24 2.8 Creating new stored procedures. 27 2.8.1 The stored procedure wizard . 29 2.8.2 SQL Assistant. 37 2.9 Building stored procedures. 47 2.10 Modifying existing stored procedures . 47 2.11 Copying and pasting stored procedures across connections. 49 2.12 The SPB additional considerations . 50 2.12.1 Java 1.2 support for the IBM DB2 Stored Procedure Builder. 51 2.12.2 Building SQL Procedures on the Intel and UNIX platforms . 52 2.12.3 UNIX installations and the SPB . 52 2.12.4 Known problems and limitations . 53 Chapter 3. SQL Procedures language. 55 3.1 Introduction to stored procedures . 55 3.2 What is the SQL Procedures language?. 56 3.3 Planning to use the SQL Procedures language . 57 3.3.1 Why use it? . 57 3.3.2 When to use SQL stored procedures? . 61 3.4 Comparing SQL procedures and external stored procedures . 64 3.4.1 Development . 64 3.4.2 Runtime . 66 3.5 Current implementation of SQL Procedures language . 66 3.5.1 How does this work in general? . 67 3.5.2 Declaring SQL local variables. 68 3.5.3 Language elements . 70 3.5.4 Handling errors in an SQL stored procedure. 92 3.5.5 Returning result sets. 103 3.6 SQL Procedures portability. 106 3.6.1 How to read the portability tables . 107 Chapter 4. IBM Distributed Debugger . 127 4.1 Distributed Debugger for the workstation . 128 4.1.1 Installing the Distributed Debugger on the workstation . 128 4.2 Distributed Debugger for OS/390 . 128 4.2.1 Installing the Distributed Debugger on OS/390 . 129 4.2.2 Setting up for remote debugging. 129 Chapter 5. OS/390 Workload Manager. 131 5.1 Introduction to OS/390 Workload Manager (WLM) . 131 5.1.1 What is WLM? . 132 iv Cross-Platform DB2 Stored Procedures: Building and Debugging 5.1.2 WLM definitions — relationships. 132 5.1.3 Classification rules . 135 5.2 Application environments . 137 5.2.1 Defining the application environment . 137 5.2.2 Specifying application environments to WLM . 138 5.3 Compatibility mode. 141 5.4 Goal mode . 142 5.5 Managing application environments . 143 5.5.1 The QUIESCE option . 144 5.5.2 The RESUME option . 144 5.5.3 The REFRESH option. 144 5.6 Handling error conditions in the application environment . 145 5.7 Defining a service definition . 145 5.8 Existing service definition . 146 5.9 RACF considerations for WLM-established address space. 147 5.10 Operations and problem determination. 148 5.11 Experimenting with goal and compatibility modes. 152 5.11.1 DB2 and WLM setup. 152 5.11.2 Client and server programs used for testing purposes . 153 5.11.3 WLM Goal mode using automatic control . 153 5.11.4 WLM compatibility mode using automatic control . 155 5.12 Refreshing the WLM environment through stored procedures . 156 5.12.1 Using the WLM_REFRESH stored procedure . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    568 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us