Micro Focus NetExpress™

Database Access

Micro Focus®

Issue 2
October 1998

Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

Micro Focus has made every effort to ensure that this manual is correct and accurate but reserves the right to make changes without notice at its sole discretion at any time.

The software described in this document is supplied under a license and may be used or copied only in accordance with the terms of such license, and in particular any warranty of fitness of Micro Focus software products for any particular purpose is expressly excluded and in no event will Micro Focus be liable for any consequential losses.

Micro Focus® is a registered trademark and Form Designer™, Micro Focus COBOL™ and NetExpress™ are trademarks of Micro Focus Limited.

Microsoft®, Windows®, and Windows for Workgroups®, are registered trademarks of Microsoft Corporation.

Visual Basic™ and Windows NT™ are trademarks of Microsoft Corporation

IBM® and DB2® are registered trademarks of International Business Machines Corporation.

UNIX® is a registered trademark of X/Open Company Limited.

Oracle® is a registered trademark of Oracle Corporation.

Sybase™ is a trademark of Sybase, Inc.

Copyright© 1987-1998 Micro Focus
All Rights Reserved.


This book describes how you can use NetExpress to create a COBOL application which uses embedded SQL to access a relational database. NetExpress provides:



This book is for NetExpress COBOL programmers who want to create or modify COBOL applications which access relational databases using embedded SQL.

It is assumed that you are already familiar with both SQL and, if you are using OpenESQL, ODBC. If you are using the DB2 ECM, it is assumed that you are familiar with DB2. If you are using COBSQL, it is assumed that you are familiar with the Oracle or Sybase database that you are accessing.

How to Use this Manual

Part One - Introduction

Chapter One, Introduction, gives a brief overview of embedded SQL and explains how you can build an embedded SQL application.

Chapter Two, Host Variables, describes host variables, host arrays, indicator variables and indicator arrays, and how they are used.

Chapter Three, Data Types, explains which data types are supported and how to map the data types used by a particular database to the correct COBOL picture clause.

Chapter Four, Cursors, details how to declare and open a cursor and how to use it to retrieve data.

Chapter Five, Data Structures, describes the SQLCA (SQL Communications Area) and the SQLDA (SQL Descriptor Area).

Chapter Six, Dynamic SQL, explains how to prepare and execute dynamic SQL.

Part Two - OpenESQL

Chapter Seven, OpenESQL, gives an overview of OpenESQL and how it works.

Chapter Eight, OpenESQL Assistant, is a tutorial which shows how you can use the OpenESQL Assistant to quickly and easily prototype SQL statements. Once you are happy with the SQL query you have created, the OpenESQL Assistant will insert the query into your program. It can also add required auxiliary code such as the CONNECT statement and host variable declarations.

Part Three - DB2

Chapter Nine, DB2, describes the DB2 ECM and how it is used.

Part Four - COBSQL

Chapter Ten, COBSQL, documents the COBSQL preprocessor explaining how it is used.


The following type styles and conventions have been used in this book: