Db2 12 for Z/OS: ODBC Guide and Reference Chapter 1

Total Page:16

File Type:pdf, Size:1020Kb

Db2 12 for Z/OS: ODBC Guide and Reference Chapter 1 Db2 12 for z/OS ODBC Guide and Reference IBM SC27-8856-02 Notes Before using this information and the product it supports, be sure to read the general information under "Notices" at the end of this information. Subsequent editions of this PDF will not be delivered in IBM Publications Center. Always download the latest edition from PDF format manuals for Db2 12 for z/OS (Db2 for z/OS Knowledge Center). 2020-11-30 edition This edition applies to Db2® 12 for z/OS® (product number 5650-DB2), Db2 12 for z/OS Value Unit Edition (product number 5770-AF3), and to any subsequent releases until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. Specific changes are indicated by a vertical bar to the left of a change. A vertical bar to the left of a figure caption indicates that the figure has changed. Editorial changes that have no technical significance are not noted. © Copyright International Business Machines Corporation 1997, 2020. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this information.......................................................................................... ix Who should read this information................................................................................................................x Db2 Utilities Suite for z/OS...........................................................................................................................x Terminology and citations............................................................................................................................x Accessibility features for Db2 12 for z/OS..................................................................................................xi How to send your comments...................................................................................................................... xi How to read syntax diagrams......................................................................................................................xi Chapter 1. Introduction to Db2 ODBC..................................................................... 1 Db2 ODBC background information............................................................................................................ 1 Differences between Db2 ODBC and ODBC 3.0.................................................................................... 2 Db2 ODBC support for ODBC features...................................................................................................2 Differences between Db2 ODBC and embedded SQL................................................................................ 4 Advantages of using Db2 ODBC...................................................................................................................7 Considerations for choosing between SQL and Db2 ODBC........................................................................ 7 Chapter 2. Conceptual view of a Db2 ODBC application...........................................9 Initialization and termination of an ODBC program..................................................................................10 Handles.................................................................................................................................................10 ODBC connection model...................................................................................................................... 11 How to specify the connection type.................................................................................................... 12 How to connect to one or more data sources..................................................................................... 13 Transaction processing in Db2 ODBC....................................................................................................... 14 Statement handle allocation................................................................................................................15 Preparation and execution of SQL statements....................................................................................16 How an ODBC program processes results...........................................................................................18 Commit and rollback in Db2 ODBC......................................................................................................21 Function for freeing statement handles.............................................................................................. 22 Diagnostics.................................................................................................................................................23 Function return codes.......................................................................................................................... 23 SQLSTATEs for ODBC error reporting.................................................................................................. 24 SQLCA retrieval in an ODBC application..............................................................................................25 Data types and data conversion................................................................................................................ 25 C and SQL data types........................................................................................................................... 25 C data types that do not map to SQL data types................................................................................. 31 Data conversion....................................................................................................................................32 Characteristics of string arguments.......................................................................................................... 34 Length of string arguments.................................................................................................................. 34 Nul-termination of strings....................................................................................................................35 String truncation...................................................................................................................................35 Interpretation of strings.......................................................................................................................35 Functions for querying environment and data source information..........................................................35 Chapter 3. Configuring Db2 ODBC and running sample applications...................... 39 Running the SMP/E jobs for Db2 ODBC installation..................................................................................39 The Db2 ODBC run time environment.......................................................................................................39 Connectivity requirements...................................................................................................................40 Extra performance linkage...................................................................................................................41 64-bit ODBC driver............................................................................................................................... 41 Db2 ODBC run time environment setup....................................................................................................41 iii Binding DBRMs to create packages.....................................................................................................42 Binding the application plan................................................................................................................ 44 Setting up Db2 ODBC for the z/OS UNIX environment....................................................................... 45 Overview of preparing and executing a Db2 ODBC application............................................................... 46 Db2 ODBC application requirements........................................................................................................ 47 Preparing and executing an ODBC application......................................................................................... 48 Compiling an ODBC application........................................................................................................... 49 Prelinking and link-editing an ODBC application.................................................................................52 Executing an ODBC application........................................................................................................... 55 How to define a subsystem to Db2 ODBC.................................................................................................56 Db2 ODBC initialization file........................................................................................................................57 How to use the initialization file...........................................................................................................57 Db2 ODBC initialization keywords....................................................................................................... 59 Database metadata stored procedures.................................................................................................... 80 Migrating to the Db2 12 ODBC driver........................................................................................................80
Recommended publications
  • A Genetic Algorithm for Database Index Selection
    GADIS: A Genetic Algorithm for Database Index Selection Priscilla Neuhaus, Julia Couto, Jonatas Wehrmann, Duncan D. Ruiz and Felipe Meneguzzi School of Technology, PUCRS - Pontifícia Universidade Católica do Rio Grande do Sul - Porto Alegre, Brazil Email: [priscilla.neuhaus, julia.couto, jonatas.wehrmann]@edu.pucrs.br, [duncan.ruiz, felipe.meneguzzi]@pucrs.br Abstract—Creating an optimal amount of indexes, taking optimize the query response time by search for faster index into account query performance and database size remains a configurations when compared to the initial one. challenge. In theory, one can speed up query response by creating We perform a set of experiments using TPC-H, a well indexes on the most used columns, although causing slower data insertion and deletion, and requiring a much larger amount of known database benchmark [11], and we compare our results memory for storing the indexing data, but in practice, it is very with three baseline approaches: (i) the initial index configura- important to balance such a trade-off. This is not a trivial task tion; and (ii) indexes derived from a random-search algorithm. that often requires action from the Database Administrator. We Results show that GADIS outperforms the baselines, allowing address this problem by introducing GADIS, A Genetic Algorithm for better index configuration on the optimized database. for Database Index Selection, designed to automatically select the best configuration of indexes adaptable for any database Finally, we observe that our approach is much more prone schema. This method aims to find the fittest individuals for to find a proper solution that the competitive methods.
    [Show full text]
  • Netezza EOL: IBM IAS Is a Flawed Upgrade Path Netezza EOL: IBM IAS Is a Flawed Upgrade Path
    Author: Marc Staimer WHITE PAPER Netezza EOL: What You’re Not Being Told About IBM IAS Is a Flawed Upgrade Path Database as a Service (DBaaS) WHITE PAPER • Netezza EOL: IBM IAS Is a Flawed Upgrade Path Netezza EOL: IBM IAS Is a Flawed Upgrade Path Executive Summary It is a common technology vendor fallacy to compare their systems with their competitors by focusing on the features, functions, and specifications they have, but the other guy doesn’t. Vendors ignore the opposite while touting hardware specs that mean little. It doesn’t matter if those features, functions, and specifications provide anything meaningfully empirical to the business applications that rely on the system. It only matters if it demonstrates an advantage on paper. This is called specsmanship. It’s similar to starting an argument with proof points. The specs, features, and functions are proof points that the system can solve specific operational problems. They are the “what” that solves the problem or problems. They mean nothing by themselves. Specsmanship is defined by Wikipedia as: “inappropriate use of specifications or measurement results to establish supposed superiority of one entity over another, generally when no such superiority exists.” It’s the frequent ineffective sales process utilized by IBM. A textbook example of this is IBM’s attempt to move their Netezza users to the IBM Integrated Analytics System (IIAS). IBM is compelling their users to move away from Netezza. In the fall of 2017, IBM announced to the Enzee community (Netezza users) that they can no longer purchase or upgrade PureData System for Analytics (the most recent IBM name for its Netezza appliances), and it will end-of-life all support next year.
    [Show full text]
  • SAP Database Administration with IBM
    André Faustmann, Michael Greulich, André Siegling, Benjamin Wegner, and Ronny Zimmerman SAP® Database Administration with IBM® DB2® Bonn Boston Contents at a Glance 1 Introduction ............................................................................ 19 2 SAP System Landscapes ......................................................... 25 3 Basics and Architecture of the IBM DB2 for LUW Database ................................................................................. 71 4 Lifecycle ................................................................................. 233 5 Administration Tools Inside and Outside the SAP System .... 327 6 Backup, Restore, and Recovery .............................................. 463 7 Monitoring DB2 SAP Systems with SAP Solution Manager .................................................................................. 575 8 SAP NetWeaver Business Warehouse and IBM DB2 for LUW .................................................................................. 647 9 Common Problems and Their Solutions for DB2 Administrators ........................................................................ 697 Contents Foreword .................................................................................... 15 Acknowledgments ....................................................................... 17 1 Introduction ................................................................. 19 1.1 Who This Book Is For .................................................... 21 1.2 Focus of This Book .......................................................
    [Show full text]
  • IBM DB2 for Z/OS: the Database for Gaining a Competitive Advantage!
    Why You Should Read This Book Tom Ramey, Director, DB2 for z/OS IBM Silicon Valley Laboratory “This book is a ‘must read’ for Enterprise customers and contains a wealth of valuable information! “It is clear that there is a technology paradigm shift underway, and this is opening enormous opportunities for companies in all industries. Adoption of Cloud, Mobile, and Analytics promises to revolutionize the way we do business and will add value to a company’s business processes across all functions from sales, marketing, procurement, manufacturing and finance. “IT will play a significant role enabling this shift. Read this book and find out how to integrate the heart of your infrastructure, DB2 for z/OS, with new technologies in order to maximize your investment and drive new value for your customers.” Located at IBM’s Silicon Valley Laboratory, Tom is the director of IBM’s premiere relational database management system. His responsibilities include Architecture, Development, Service, and Customer Support for DB2. He leads development labs in the United States, Germany, and China. Tom works closely with IBM’s largest clients to ensure that DB2 for z/OS continues as the leading solution for modern applications, encompassing OLTP to mobile to analytics. At the same time he continues an uncompromising focus on meeting the needs of the most demanding operational environments on Earth, through DB2’s industry- leading performance, availability, scaling, and security capabilities. IBM DB2 for z/OS: The Database for Gaining a Competitive Advantage! Shantan Kethireddy Jane Man Surekha Parekh Pallavi Priyadarshini Maryela Weihrauch MC Press Online, LLC Boise, ID 83703 USA IBM DB2 for z/OS: The Database for Gaining a Competitive Advantage! Shantan Kethireddy, Jane Man, Surekha Parekh, Pallavi Priyadarshini, and Maryela Weihrauch First Edition First Printing—October 2015 © Copyright 2015 IBM.
    [Show full text]
  • Response Time Analysis on Indexing in Relational Databases and Their Impact
    Response time analysis on indexing in relational databases and their impact Sam Pettersson & Martin Borg 18, June, 2020 Dept. Computer Science & Engineering Blekinge Institute of Technology SE–371 79 Karlskrona, Sweden This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfillment of the requirements for the bachelor’s degree in software engineering. The thesis is equivalent to 10 weeks of full-time studies. Contact Information: Authors: Martin Borg E-mail: [email protected] Sam Pettersson E-mail: [email protected] University advisor: Associate Professor. Mikael Svahnberg Dept. Computer Science & Engineering Faculty of Computing Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 SE–371 79 Karlskrona, Sweden Fax : +46 455 38 50 57 Abstract This is a bachelor thesis concerning the response time and CPU effects of indexing in relational databases. Analyzing two popular databases, PostgreSQL and MariaDB with a real-world database structure us- ing randomized entries. The experiment was conducted with Docker and its command-line interface without cached values to ensure fair outcomes. The procedure was done throughout seven different create, read, update and delete queries with multiple volumes of database en- tries to discover their strengths and weaknesses when utilizing indexes. The results indicate that indexing has an overall enhancing effect on almost all of the queries. It is found that join, update and delete op- erations benefits the most from non-clustered indexing. PostgreSQL gains the most from indexes while MariaDB has less of an improvement in the response time reduction.
    [Show full text]
  • Relational Database Index Design
    RReellaattiioonnaall DDaattaabbaassee IInnddeexx DDeessiiggnn Prerequisite for Index Design Workshop Tapio Lahdenmaki April 2004 Copyright Tapio Lahdenmaki, DBTech Pro 1 Relational Database Index Design CHAPTER 1: INTRODUCTION........................................................................................................................4 INADEQUATE INDEXING .......................................................................................................................................4 THE IMPACT OF HARDWARE EVOLUTION ............................................................................................................5 Volatile Columns Should Not Be Indexed – True Or False? ..........................................................................7 Example ..........................................................................................................................................................7 Disk Drive Utilisation.....................................................................................................................................8 SYSTEMATIC INDEX DESIGN ................................................................................................................................9 CHAPTER 2........................................................................................................................................................13 TABLE AND INDEX ORGANIZATION ........................................................................................................13 INTRODUCTION
    [Show full text]
  • IBM DB2 for I Indexing Methods and Strategies Learn How to Use DB2 Indexes to Boost Performance
    IBM DB2 for i indexing methods and strategies Learn how to use DB2 indexes to boost performance Michael Cain Kent Milligan DB2 for i Center of Excellence IBM Systems and Technology Group Lab Services and Training July 2011 © Copyright IBM Corporation, 2011 Table of contents Abstract........................................................................................................................................1 Introduction .................................................................................................................................1 The basics....................................................................................................................................3 Database index introduction .................................................................................................................... 3 DB2 for i indexing technology .................................................................................................................. 4 Radix indexes.................................................................................................................... 4 Encoded vector indexes .................................................................................................... 6 Bitmap indexes - the limitations ....................................................................................................... 6 EVI structure details......................................................................................................................... 7 EVI runtime usage...........................................................................................................................
    [Show full text]
  • Developing Embedded SQL Applications
    IBM DB2 10.1 for Linux, UNIX, and Windows Developing Embedded SQL Applications SC27-3874-00 IBM DB2 10.1 for Linux, UNIX, and Windows Developing Embedded SQL Applications SC27-3874-00 Note Before using this information and the product it supports, read the general information under Appendix B, “Notices,” on page 209. Edition Notice This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at http://www.ibm.com/shop/publications/ order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at http://www.ibm.com/ planetwide/ To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright IBM Corporation 1993, 2012. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Introduction to embedded Include files for COBOL embedded SQL SQL................1 applications .............29 Embedding SQL statements
    [Show full text]
  • Proc SQL Vs. Pass-Thru SQL on DB2® Or How I Found a Day
    NESUG 15 Beginning Tutorials Proc SQL vs. Pass-Thru SQL on DB2® Or How I Found a Day Jeffrey S. Cohen, American Education Services/PHEAA Abstract When extracting data from multiple tables, you must employ Join conditions to avoid a Cartesian product, Many people use Proc SQL to query DB2 where each row from table one will be joined with databases yet ignore the Pass-thru ability of this each row in table two. A Join condition will tell the Proc. This paper will compare the Proc SQL of DBMS how to match the rows of the two tables. Consider the above example, only now we want the SAS® and Pass-thru SQL on the same 30 million- color of the person's car as well: row table to highlight the time and resource Select A.Name, savings that Pass-through SQL can give. A.Age, A.City, Overview B.Color From Table_Demographics A Inner Join One of the most useful features of SAS software is Table_Cars B on its ability to read data in almost any form or A.Name = B.Name storage medium from multiple data sets. When Where A.Age < 30 and accessing data from a Database Management (A.City = 'Syracuse' or System (DBMS) such as DB2, the SQL procedure A.State = 'Maine') is required. Like many SAS procedures there are a Notice that when selecting multiple columns a variety of options available, some greatly comma must separate them. Also notice that the impacting performance. We will examine three table Table_Demographics is given the pseudonym techniques to use when joining three tables with of A and the table Table_Cars is given the Proc SQL and the results on performance.
    [Show full text]
  • Sql Server Index Fragmentation Report
    Sql Server Index Fragmentation Report Reflexive Clayborne miaows, his vibrometer tuck swelled silverly. Improbable Lionello always winches his ironist if Wain is executive or excite incompetently. Cornelius remains noble after Timothy ionizing perceptually or priggings any writes. Fragmentation in DM SQL Diagnostic Manager for SQL Server. Regular indexes rebuild at SQL-Server 200 and higher necessary Posted on Apr 01 2011. This will rejoice you owe determine the upcoming impact should any changes made. You use need to retype it select another editor or in SSMS. Is there something I need to invoke to cause it to be available? Dmf to sql server and reformat them to check index automatically by fragmented, and reorganize operations are. Index operation is not resumable. Httpblogsqlauthoritycom20100112sql-server-fragmentation-detect-fragmentation-and-eli minate-. How to Proactively Gather SQL Server Indexes Fragmentation. Indexes play a vital role in the performance of SQL Server applications Indexes are created on columns in tables or views and objective a quick. DO NOT do this during office hours. Please contact your sql servers that fragmented indexes and reports tab, indexing data published on thresholds to continue browsing experience in one person? Thanks for the code. And server reporting any fragmented indexes optimization was creating storage and easy to report taking into block right on this index for servers are reclaimed on modern frozen meals at that? Just a restore from backup, schools, monitoring and high availability and disaster recovery technologies. Dmdbindexphysicalstats to report fragmentation of bird and indexes for a specified table mountain view Many companies use maintenance plans to work regular.
    [Show full text]
  • Database Performance on AIX in DB2 UDB and Oracle Environments
    Database Performance on AIX in DB2 UDB and Oracle Environments Nigel Griffiths, James Chandler, João Marcos Costa de Souza, Gerhard Müller, Diana Gfroerer International Technical Support Organization www.redbooks.ibm.com SG24-5511-00 SG24-5511-00 International Technical Support Organization Database Performance on AIX in DB2 UDB and Oracle Environments December 1999 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix E, “Special notices” on page 411. First Edition (December 1999) This edition applies to Version 6.1 of DB2 Universal Database - Enterprise Edition, referred to as DB2 UDB; Version 7 of Oracle Enterprise Edition and Release 8.1.5 of Oracle8i Enterprise Edition, referred to as Oracle; for use with AIX Version 4.3.3. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JN9B Building 003 Internal Zip 2834 11400 Burnet Road Austin, Texas 78758-3493 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. 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 Preface...................................................xv How this book is organized .......................................xv The team that wrote this redbook. ..................................xvi Commentswelcome.............................................xix Chapter 1. Introduction to this redbook .........................1 Part 1. RDBMS concepts .................................................3 Chapter 2. Introduction into relational database system concepts....5 2.1WhatisanRDBMS?.......................................5 2.2 What does an RDBMS provide? .
    [Show full text]
  • Toad for IBM DB2 Release Notes
    Toad for IBM DB2 7.1.x Release Notes Monday, November 18, 2019 Contents About Toad for IBM DB2 1 New Features 1 System Requirements 2 Resolved Issues and Enhancements 4 Known Issues 4 Third Party Known Issues 6 Getting Started 7 Toad for DB2 Editions 7 Product Licensing 8 Globalization 8 About Us 9 Copyright 9 About Toad for IBM DB2 With Toad, developers and database administrators can use a familiar, proven tool to manage databases. Toad empowers developers and administrators, of varying skill levels, to rapidly create and execute queries, automate database object management, and develop SQL more efficiently. Toad also provides utilities to compare, extract and search for objects, manage projects, import/export data and administer the database, while increasing your productivity and delivering access to an active user community. Toad for IBM DB2 7.1.2 is a patch release with new features, security enhancements and resolved issues. New Features In Toad for IBM DB2 7.1 the following new features were implemented: Security and Installation Enhancements For this release of Toad for IBM DB2 we have provided internal security adjustments. We have revised a list of third party components in use according to their known and potential vulnerabilities. Toad uses only reliable and safe components by third party vendors. See the list of third party components in Toad for IBM DB2the help file, section About Us | Third Party Components. Our Toad installers are now based on the Wix Toolset , which improves user experience and performance of the installation process. See Resolved Issues for more enhancements and resolved issues in this release of Toad for IBM DB2.
    [Show full text]