Progress Dataserver For Odbc Guide
Progress Dataserver For Odbc Guide
Progress Dataserver For Odbc Guide
DataServer
for ODBC Guide
©
2001 Progress Software Corporation. All rights reserved.
Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation.
This manual is also copyrighted and all rights are reserved. This manual may not, in whole or in part, be
copied, photocopied, translated, or reduced to any electronic medium or machine-readable form without
prior consent, in writing, from Progress Software Corporation.
The information in this manual is subject to change without notice, and Progress Software Corporation
assumes no responsibility for any errors that may appear in this document.
The references in this manual to specific platforms supported are subject to change.
Progress, Progress Results, Provision and WebSpeed are registered trademarks of Progress Software
Corporation in the United States and other countries. Apptivity, AppServer, ProVision Plus, SmartObjects,
IntelliStream, and other Progress product names are trademarks of Progress Software Corporation.
SonicMQ is a trademark of Sonic Software Corporation in the United States and other countries.
Progress Software Corporation acknowledges the use of Raster Imaging Technology copyrighted by
Snowbound Software 1993-1997 and the IBM XML Parser for Java Edition.
©
IBM Corporation 1998-1999. All rights reserved. U.S. Government Users Restricted Rights — Use,
duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Progress is a registered trademark of Progress Software Corporation and is used by IBM Corporation in the
mark Progress/400 under license. Progress/400 AND 400® are trademarks of IBM Corporation and are used
by Progress Software Corporation under license.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the
United States and other countries.
Any other trademarks and/or service marks contained herein are the property of their respective owners.
.
May 2001
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Organization of This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Syntax Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Progress Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Other Useful Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Reporting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
4GL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
DataServers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
SQL-89/Open Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
WebSpeed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
1.1 DataServer Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
1.1.1 DataServer for ODBC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . 1–6
1.1.2 The Schema Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–7
1.1.3 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–8
1.2 DataServer Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–9
1.3 DataServer Demonstration Databases . . . . . . . . . . . . . . . . . . . . . . . . . . 1–10
1.4 DataServer Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–10
1.4.1 The Local DataServer Configuration . . . . . . . . . . . . . . . . . . . . 1–11
Contents
iv
Contents
v
Contents
vi
Contents
6. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1
6.1 Tuning Your Environment with the -Dsrv Startup Parameter . . . . . . . . . 6–2
6.1.1 ODBC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–3
6.1.2 DataServer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
6.1.3 Using ODBC and DataServer Options . . . . . . . . . . . . . . . . . . 6–7
6.2 ODBC Driver Problems on Windows Platforms . . . . . . . . . . . . . . . . . . . 6–11
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
vii
Contents
Figures
Figure 1–1: Architecture for DataServer for ODBC . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
Figure 1–2: DataServer Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–6
Figure 1–3: The Schema-loading Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–8
Figure 1–4: The Local DataServer for ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–11
Figure 1–5: The Remote DataServer for ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–12
Figure 1–6: The Distributed DataServer for ODBC Using ProBroker . . . . . . . . . . . . 1–14
Figure 2–1: DataServer Processes and Code Pages . . . . . . . . . . . . . . . . . . . . . . . 2–7
viii
Contents
Tables
Table 1–1: DataServer Architecture Components . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
Table 1–2: Supported Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–13
Table 1–3: How to Use This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–23
Table 1–4: DataServer-related Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–24
Table 2–1: Progress Database Objects and ODBC Data-source Objects . . . . . . . 2–3
Table 2–2: Progress Database and ODBC Data-source Naming Restrictions . . . 2–5
Table 2–3: DB2 Data-type Equivalencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–16
Table 2–4: Informix Data-type Equivalencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–17
Table 2–5: Microsoft Access Data-type Equivalencies . . . . . . . . . . . . . . . . . . . . . 2–18
Table 2–6: Sybase and Microsoft SQL Server 6.5 Data-type Equivalencies . . . . . 2–20
Table 2–7: Progress and Data-source Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–27
Table 2–8: 4GL Differences for Progress Databases and ODBC Data Sources . . 2–44
Table 2–9: Argument Data Types for Stored Procedures . . . . . . . . . . . . . . . . . . . 2–47
Table 2–10: Returning Values from Stored Procedures . . . . . . . . . . . . . . . . . . . . . 2–48
Table 2–11: Query-tuning Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–62
Table 2–12: Controlling Join by SQLDB Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . 2–67
Table 3–1: Installing the DataServer Components . . . . . . . . . . . . . . . . . . . . . . . . 3–2
Table 3–2: Environment Variables for the Remote DataServer . . . . . . . . . . . . . . . 3–10
Table 3–3: DataServer for ODBC Sections of the ubroker.properties File . . . . . . 3–12
Table 3–4: ODBC Data-source and Progress Code Pages . . . . . . . . . . . . . . . . . . 3–21
Table 4–1: DataServer Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 4–10
Table 4–2: Connection Query-tuning Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–18
Table 4–3: Diagnostic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–20
Table 4–4: Failure Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–22
Table 5–1: Progress-to-ODBC Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3
Table 5–2: DataServer Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–6
Table 5–3: Verify Utility Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Table 5–4: ODBC Data-source and Progress Code Pages . . . . . . . . . . . . . . . . . . 5–20
Table 5–5: Progress-to-ODBC Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–26
Table 5–6: Progress-to-ODBC Utility Batch Parameters . . . . . . . . . . . . . . . . . . . . 5–29
Table 6–1: ODBC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–3
Table 6–2: DataServer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
Table C–1: DataServer Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C–15
ix
Contents
Procedures
find.p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–41
x
Preface
Purpose
This manual explains how to use the Progress DataServer for ODBC. It provides startup
instructions and a brief tutorial that introduces the utilities that support the DataServer.
Additionally, it discusses database design and programming issues to consider when creating
applications that access the Progress and ODBC database management systems.
Audience
This book is intended for programmers who want to develop Progress applications that run with
ODBC-compliant databases. It assumes a fundamental knowledge of both Progress and ODBC.
Discusses the differences between Progress databases and supported ODBC data sources
and the DataServer strategies for resolving these differences. Includes database design
issues, application issues, Progress 4GL issues, stored procedures, and DataServer
performance enhancement.
Presents instructions for configuring the DataServer and for creating, maintaining, and
deploying a schema holder.
Progress DataServer for ODBC Guide
Presents various methods for starting and for connecting the DataServer and describes
connecting a schema holder. In addition, it provides connection guidelines and lists
connection failures and Progress responses.
Provides an overview of the ODBC demonstration databases and the opportunity to work
with the DataServer utilities for maintaining a schema holder. In addition, it describes the
Progress-to-ODBC migration utility.
Chapter 6, “Troubleshooting”
Describes common problems and how to work around them, including tuning your
environment and ODBC driver problems.
Provides information on how to upgrade from an earlier version of either the DataServer
or an ODBC data source.
Describes the Progress 4GL statements and functions that support running ODBC
data-source stored procedures.
Describes the utilities you use to configure, manage, start, and stop the DataServer host
and client.
xii
Preface
Typographical Conventions
This manual uses the following typographical conventions:
– New terms
– Code examples
– System output
• Small capitals are used for Progress key functions and generic keyboard keys.
END-ERROR, GET, GO
ALT, CTRL, SPACEBAR, TAB
• When you have to press a combination of keys, they are joined by a dash. You press and
hold down the first key, then press the second key.
CTRL-X
• When you have to press and release one key, then press another key, the key names are
separated with a space.
ESCAPE H
ESCAPE CURSOR-LEFT
xiii
Progress DataServer for ODBC Guide
Syntax Notation
The syntax for each component follows a set of conventions:
• Uppercase words are keywords. Although they are always shown in uppercase, you can
use either uppercase or lowercase when using them in a procedure.
SYNTAX
• Italics identify options or arguments that you must supply. These options can be defined
as part of the syntax or in a separate syntax identified by the name in italics. In the
ACCUM function above, the aggregate and expression options are defined with the
syntax for the ACCUM function in the Progress Language Reference.
• You must end all statements (except for DO, FOR, FUNCTION, PROCEDURE, and
REPEAT) with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT
statements can end with either a period or a colon, as in this example:
• Square brackets ([ ] ) around an item indicate that the item, or a choice of one of the
enclosed items, is optional.
SYNTAX
In some instances, square brackets are not a syntax notation, but part of the language.
xiv
Preface
For example, this syntax for the INITIAL option uses brackets to bound an initial value
list for an array variable definition. In these cases, normal text brackets ( [ ] ) are used:
SYNTAX
• Braces ({ }) around an item indicate that the item, or a choice of one of the enclosed
items, is required.
In this example, you must specify the items BY and expression and can optionally specify
the item DESCENDING, in that order:
SYNTAX
{ BY expression [ DESCENDING ]}
In some cases, braces are not a syntax notation, but part of the language.
For example, a called external procedure must use braces when referencing arguments
passed by a calling procedure. In these cases, normal text braces ( { } ) are used:
SYNTAX
{ &argument-name }
In this example, EACH, FIRST, and LAST are optional, but you can only choose one:
SYNTAX
xv
Progress DataServer for ODBC Guide
SYNTAX
• Ellipses (...) indicate that you can choose one or more of the preceding items. If a group
of items is enclosed in braces and followed by ellipses, you must choose one or more of
those items. If a group of items is enclosed in brackets and followed by ellipses, you can
optionally choose one or more of those items.
In this example, you must include two expressions, but you can optionally include more.
Note that each subsequent expression must be preceded by a comma:
SYNTAX
In this example, you must specify MESSAGE, then at least one of expression or SKIP, but
any additional number of expression or SKIP is allowed:
SYNTAX
In this example, you must specify {include-file, then optionally any number of argument
or &argument-name = "argument-value", and then terminate with }:
SYNTAX
{ include-file
[ argument | &argument-name = "argument-value" ] ... }
• In some examples, the syntax is too long to place in one horizontal row. In such cases,
optional items appear individually bracketed in multiple rows in order, left-to-right and
top-to-bottom. This order generally applies, unless otherwise specified. Required items
also appear on multiple rows in the required order, left-to-right and top-to-bottom. In cases
where grouping and order might otherwise be ambiguous, braced (required) or bracketed
(optional) groups clarify the groupings.
xvi
Preface
SYNTAX
In this example, ASSIGN requires one of two choices: either one or more of field, or one
of record. Other options available with either field or record are grouped with braces and
brackets. The open and close braces indicate the required order of options:
SYNTAX
Progress Messages
Progress displays several types of messages to inform you of routine and unusual occurrences:
• Compile messages inform you of errors found while Progress is reading and analyzing a
procedure prior to running it (for example, if a procedure references a table name that is
not defined in the database).
• Startup messages inform you of unusual conditions detected while Progress is getting
ready to execute (for example, if you entered an invalid startup parameter).
• Continues execution, subject to the error-processing actions that you specify, or that are
assumed, as part of the procedure. This is the most common action taken following
execution messages.
xvii
Progress DataServer for ODBC Guide
• Returns to the Progress Procedure Editor so that you can correct an error in a procedure.
This is the usual action taken following compiler messages.
• Halts processing of a procedure and returns immediately to the Procedure Editor. This
does not happen often.
Progress messages end with a message number in parentheses. In this example, the message
number is 200:
Use Progress online help to get more information about Progress messages. Many Progress
tools include the following Help menu options to provide information about messages:
• Choose Help→ Recent Messages to display detailed descriptions of the most recent
Progress message and all other messages returned in the current session.
• Choose Help→ Messages, then enter the message number to display a description of any
Progress message. (If you encounter an error that terminates Progress, make a note of the
message number before restarting.)
xviii
Preface
Getting Started
Progress Electronic Documentation Installation and Configuration Guide (Hard copy only)
A booklet that describes how to install the Progress EDOC viewer and collection on UNIX
and Windows.
A manual that describes how to install and set up Progress Version 9.1 for the UNIX
operating system.
A manual that describes how to install and set up Progress Version 9.1 for all supported
Windows and Citrix MetaFrame operating systems.
A guide that provides a brief description of each new feature of the release. The booklet
also explains where to find more detailed information in the documentation set about each
new feature.
Progress Language Tutorial for Windows and Progress Language Tutorial for Character
Platform-specific tutorials designed for new Progress users. The tutorials use a
step-by-step approach to explore the Progress application development environment using
the 4GL.
xix
Progress DataServer for ODBC Guide
Progress Master Glossary for Windows and Progress Master Glossary for Character (EDOC
only)
Platform-specific master glossaries for the Progress documentation set. These books are
in electronic format only.
Progress Master Index and Glossary for Windows and Progress Master Index and Glossary for
Character (Hard copy only)
Platform-specific master indexes and glossaries for the Progress hard-copy documentation
set.
A reference manual that describes the Progress startup commands and parameters in
alphabetical order.
A booklet that explains how Progress software and media are packaged. An icon-based
map groups the documentation by functionality, providing an overall view of the
documentation set. Welcome to Progress also provides descriptions of the various services
Progress Software Corporation offers.
Development Tools
Progress ADM 2 Guide
A programmer’s guide to using the Progress AppBuilder visual layout editor. AppBuilder
is a Rapid Application Development (RAD) tool that can significantly reduce the time and
effort required to create Progress applications.
xx
Preface
Progress Basic Database Tools (Character only; information for Windows is in online help)
A guide for the Progress Database Administration tools, such as the Data Dictionary.
Progress Basic Development Tools (Character only; information for Windows is in online help)
A guide for the Progress development toolset, including the Progress Procedure Editor and
the Application Compiler.
A guide for the Progress Application Debugger. The Debugger helps you trace and correct
programming errors by allowing you to monitor and modify procedure execution as it
happens.
A guide that describes how to develop and integrate an online help system for a Progress
application.
A guide that describes how to use the Progress Translation Manager tool to manage the
entire process of translating the text phrases in Progress applications.
A guide that describes how to use the Progress Visual Translator tool to translate text
phrases from procedures into one or more spoken languages.
Reporting Tools
Progress Report Builder Deployment Guide (Windows only)
An administration and development guide for generating Report Builder reports using the
Progress Report Engine.
A tutorial that provides step-by-step instructions for creating eight sample Report Builder
reports.
xxi
Progress DataServer for ODBC Guide
A guide for system administrators that describes how to set up and maintain the Results
product in a graphical environment. This guide also describes how to program, customize,
and package Results with your own products. In addition, it describes how to convert
character-based Results applications to graphical Results applications.
Progress Results User’s Guide for Windows and Progress Results User’s Guide for UNIX
Platform-specific guides for users with little or no programming experience that explain
how to query, report, and update information with Results. Each guide also helps advanced
users and application developers customize and integrate Results into their own
applications.
4GL
Building Distributed Applications Using the Progress AppServer
A guide to accessing non-Progress applications from Progress. This guide describes how
to use system clipboards, UNIX named pipes, Windows dynamic link libraries, Windows
dynamic data exchange, Windows ActiveX controls, and the Progress Host Language Call
Interface to communicate with non-Progress applications and extend Progress
functionality.
A guide to developing Progress applications for markets worldwide. The guide covers
both internationalization—writing an application so that it adapts readily to different
locales (languages, cultures, or regions)—and localization—adapting an application to
different locales.
xxii
Preface
A three-volume reference set that contains extensive descriptions and examples for each
statement, phrase, function, operator, widget, attribute, method, and event in the Progress
language.
Database
Progress Database Design Guide
A guide that uses a sample database and the Progress Data Dictionary to illustrate the
fundamental principles of relational database design. Topics include relationships,
normalization, indexing, and database triggers.
This guide describes Progress database administration concepts and procedures. The
procedures allow you to create and maintain your Progress databases and manage their
performance.
DataServers
Progress DataServer Guides
These guides describe how to use the DataServers to access non-Progress databases. They
provide instructions for building the DataServer modules, a discussion of programming
considerations, and a tutorial. Each DataServer has its own guide as follows:
The Enterprise DataServer for ODBC includes MERANT ODBC drivers for all the
supported data sources. For configuration information, see the MERANT documentation,
which is available as a PDF file in installation-path\odbc. To read this file you must
have the Adobe Acrobat Reader installed on your system. If you do not have the Adobe
Acrobat Reader, you can download it from the Adobe Web site at:
http://www.adobe.com/prodindex/acrobat/readstep.html.
xxiii
Progress DataServer for ODBC Guide
SQL-89/Open Access
Progress Embedded SQL-89 Guide and Reference
A guide that describes how to write and deploy Java and ActiveX applications that run as
clients of the Progress AppServer. The guide includes information about how to expose
the AppServer as a set of Java classes or as an ActiveX server.
A user guide and reference for programmers who use interactive Progress/SQL-89. It
includes information on all supported SQL-89 statements, SQL-89 Data Manipulation
Language components, SQL-89 Data Definition Language components, and supported
Progress functions.
SQL-92
Progress Embedded SQL-92 Guide and Reference
A guide to the Java Database Connectivity (JDBC) interface and the Progress SQL-92
JDBC driver. It describes how to set up and use the driver and details the driver’s support
for the JDBC interface.
xxiv
Preface
A guide to the ODBC interface and the Progress SQL-92 ODBC driver. It describes how
to set up and use the driver and details the driver’s support for the ODBC interface.
A user guide and reference for programmers who use Progress SQL-92. It includes
information on all supported SQL-92 statements, SQL-92 Data Manipulation Language
components, SQL-92 Data Definition Language components, and Progress functions. The
guide describes how to use the Progress SQL-92 Java classes and how to create and use
Java stored procedures and triggers.
Deployment
Progress Client Deployment Guide
A guide that describes the client deployment process and application administration
concepts and procedures.
A guide to using the Developer’s Toolkit. This guide describes the advantages and
disadvantages of different strategies for deploying Progress applications and explains how
you can use the Toolkit to deploy applications with your selected strategy.
A guide that explains how to use the Progress toolset to build applications that are portable
across all supported operating systems, user interfaces, and databases, following the
Progress programming model.
WebSpeed
Getting Started with WebSpeed
Provides an introduction to the WebSpeed Workshop tools for creating Web applications.
It introduces you to all the components of the WebSpeed Workshop and takes you through
the process of creating your own Intranet application.
Provides instructions for installing WebSpeed on Windows and UNIX systems. It also
discusses designing WebSpeed environments, configuring WebSpeed Brokers,
WebSpeed Agents, and the NameServer, and connecting to a variety of data sources.
xxv
Progress DataServer for ODBC Guide
Provides a complete overview of WebSpeed and the guidance necessary to develop and
deploy WebSpeed applications on the Web.
A booklet that provides a brief description of each new feature of the release. The booklet
also explains where to find more detailed information in the documentation set about each
new feature.
A booklet that explains how WebSpeed software and media are packaged. Welcome to
WebSpeed! also provides descriptions of the various services Progress Software
Corporation offers.
Reference
Pocket Progress (Hard copy only)
A reference that lets you quickly look up information about the Progress language or
programming environment.
A reference that lets you quickly look up information about the SpeedScript language or
the WebSpeed programming environment.
xxvi
1
Introduction
The DataServer for ODBC allows you to develop and deploy Progress 4GL or WebSpeed
applications that access the following ODBC-compliant data sources: DB2â (DB2/NT,
DB2/6000, and DB2/MVS), Informixâ, Microsoftâ Access, Microsoft SQL Server, and
Sybaseâ. Throughout this manual, the term ODBC data sources, or simply data sources, refers
specifically to these data sources.The DataServer for ODBC fully supports the Microsoft SQL
Server features for Version 6.5 and lower. To obtain DataServer support for Microsoft SQL
Server 7.0 or higher use the Progress DataServer for Microsoft SQL Server. The
DataServer for ODBC is fully compliant with ODBC-3.5. However, the DataServer for ODBC
only partially implements ODBC-2.0 and ODBC-3.0 features, such as stored procedures. For
more information on stored procedures and other programming feature functionality, see
Chapter 2, “Programming Considerations.”
The DataServer for ODBC allows you to access your ODBC data source with the Progress 4GL
and develop applications within the Progress Application Development Environment (ADE).
The ADE is a set of tools that helps you to maintain data sources and develop applications with
graphical user interfaces. In addition to providing you with the ADE tools, the DataServer
allows you to implement the Progress database features and Progress 4GL expansions in
applications that run with the supported data sources. Some of these tools and features are:
• AppBuilder or WebSpeed applications. Use the AppBuilder to design and generate code
for your graphical user interfaces. For example, you can use the AppBuilder to create a
browse widget for viewing data stored in your foreign data source.
• Data Dictionary. Use the Data Dictionary to modify database schema; create indexes; and
define database triggers, validation expressions, and help messages.
• Database triggers. Use a trigger to fire a block of Progress 4GL code whenever a specific
data source event occurs; for example, when creating or deleting a record or assigning a
value to a field.
Note that using the DataServer to access an ODBC data source does not provide you with access
to all Progress 4GL, WebSpeed, and database features. For details, see Chapter 2,
“Programming Considerations.”
Two versions of the DataServer for ODBC are available:
• The Enterprise DataServer for ODBC is a fully featured DataServer with a wide range of
deployment flexibility and scalability. The following are a few of the features:
– The ODBC drivers for the supported data sources are bundled with the Enterprise
version.
NOTE: To install and use an ODBC driver successfully, your system must meet the driver
system requirements for connecting to data sources. These system requirements are
documented in the DataDirect Connect Reference available on the Progress product
CD in Adobe Acrobat PDF format. You can view and print this book using Acrobat
Reader licensed from Adobe Systems. You can download the Acrobat Reader
software from the Adobe Web site at no charge. The URL for the Acrobat Reader is:
http://www.adobe.com/prodindex/acrobat/readstep.html.
• The Personal DataServer for ODBC provides the same features as the Enterprise version
except for the following restrictions:
– The ODBC drivers are not bundled with the Personal version. The drivers must be
purchased separately from the vendor.
1–2
Introduction
This manual documents both versions and uses the term DataServer for ODBC to refer to
features and functionality that are common to both. Features and functions that are specific to
the Personal DataServer or the Enterprise DataServer are noted as such.
This chapter describes the DataServer for ODBC and discusses how Progress and WebSpeed
applications work with it to access data sources through the ODBC standard. It discusses the
following topics:
• DataServer components, including DataServer logic, the schema holder, security, utilities,
the demonstration database, and configurations
• Software requirements
Subsequent chapters provide additional information about using the DataServer. If you are
using the DataServer with WebSpeed and with applications written in SpeedScript, all
information regarding Progress 4GL applies to your application.
NOTE: Do not attempt to use the DataServer without first reading the Progress Release
notes, the Progress Installation and Configuration Guide Version 9 for Windows and
the programming guidelines in Chapter 2. Also, be sure to follow the step-by-step
instructions in Chapter 3, “Configuring the DataServer,” and Chapter 4, “Connecting
the DataServer,” for installing, configuring, and connecting to a data source.
1–3
Progress DataServer for ODBC Guide
Component Description
Enterprise DataServer for ODBC A Progress software module that allows you to use
Progress or WebSpeed with a supported ODBC data
Personal DataServer for ODBC
source.
Schema holder A repository for data definitions for one or more ODBC
data sources.
ODBC data source A name that identifies a specific set of data and how to
obtain it. You must register a supported database as an
(Windows platforms only)
ODBC data source.
DataServer ODBC utilities A set of utilities that allows you to perform certain tasks
related to the DataServer. You access them from the
Progress Data Administration tool.
1–4
Introduction
Figure 1–1 illustrates how the DataServer components are organized for both the Enterprise and
the Personal DataServer for ODBC.
Enterprise
Progress or Webspeed Application ODBC
Personal Client
ODBC
Client Enterprise
Progress Enterprise DataServer
ODBC
for ODBC
Server
ODBC ODBC
Driver Driver
1–5
Progress DataServer for ODBC Guide
1 5
The user runs a Progress or The client displays the
WebSpeed application. returned results.
The DataServer
translates a statement
into SQL.
SELECT name
FROM customer.
ODBC API
4
3 The data source manager
The data source compiles the request and
manager receives the returns the results to the
SQL statements from client.
the DataServer.
"Second Skin Scuba"
SELECT name "Match Point Tennis"
FROM customer. "Off The Wall"
"Pedal Power Cycles"
1–6
Introduction
As shown in Figure 1–2, when you execute an application that accesses a supported data source,
the Compiler translates Progress 4GL or SpeedScript statements into their SQL equivalents.
The DataServer then issues the SQL statements to the appropriate ODBC driver through the
ODBC API. The driver, which provides the software mechanisms for accessing and controlling
the data source, processes the SQL statements, transfers them to the data source manager, and
returns the results to Progress through the ODBC API.
In order to facilitate the flow of statements between client and server, the DataServer places
Progress equivalents for data definitions from a supported data source into a schema holder (a
repository for data definitions for one or more ODBC data sources). When the Progress client
or WebSpeed Agent executes statements and retrieves information from the data source, it relies
on data definitions in the schema holder.
1–7
Progress DataServer for ODBC Guide
Progress
Schema Holder Data Source
Data Definitions
For information on using RUN STORED–PROCEDURE, see the “Stored Procedures” section
in Chapter 2, “Programming Considerations.”
1.1.3 Security
Using the DataServer for ODBC involves following the security guidelines required by both the
Progress database and the ODBC data source. By default, Progress allows unrestricted access
to data sources, so at minimum, you should follow the guidelines that the data source requires
for your applications.
Progress Security
The Progress database management system has no minimum security requirements. You can,
however, impose security features on any Progress database or schema holder. There are four
levels of application security that you can impose:
• Database-connection security
• Schema security
1–8
Introduction
• Compile-time security
• Run-time security
For more information on Progress security, see the data security chapter in the Progress
Programming Handbook.
• System administrators can grant or revoke permissions to other users to create or own a
wide type of objects; for example, databases.
• Database owners can grant other users permission to access or modify a database or its
objects.
For more information on database security, see the documentation for your data source.
NOTE: There are specific security requirements for accessing data with the DataServer that
relate to creating a schema holder. For details, see the “Creating a Schema Holder”
section in Chapter 3, “Configuring the DataServer.”
• Verifying that the definitions in the schema holder match the current data source
information
1–9
Progress DataServer for ODBC Guide
In addition, you can use the Progress Data Dictionary to modify data definitions at the field
level; for example, to change display formats, add help messages, or add validation expressions.
You can also use the Progress Data Administration tool to manipulate data definition files for
the schema holder.
• Local DataServer—All of the DataServer software components, the schema holder, the
ODBC software, and your data-source client software run on one machine.
1–10
Introduction
the host machine using the Progress ProBroker executable or broker in the Progress
Explorer administration framework.
The Personal DataServer for ODBC runs only in a local DataServer environment. It cannot be
run in the remote (or distributed) DataServer configuration.
Progress Client
DataServer
ODBC Driver
Schema Data
Holder Source
1–11
Progress DataServer for ODBC Guide
In the local DataServer configuration, all of the DataServer software components, the schema
holder, and any ODBC data-source client software run on the same machine. Depending on the
ODBC and data-source client software implementation, the actual target database may be local
or remote to the machine where the local Progress DataServer for ODBC executes. If the
data-source client software supplies modules that manage networked database communications,
a remote database configuration is possible. The DataServer cares only about the local ODBC
data-source definition. Remote database access is transparent to the DataServer.
DataServer
ODBC Driver
Progress
Networking Data-Source
Client Software
Schema Data
Holder Source
1–12
Introduction
Figure 1–5 shows a remote DataServer configuration. Table 1–2 lists the supported
configurations. It contains possible client-server combinations and networking options.
Progress on all Windows None The server, client, ODBC client, and data
and NT platforms1 source are on the same machine.
You can configure both the Personal and
Enterprise DataServers for ODBC in this
way. (The Personal DataServer for
ODBC is restricted to single-user
Windows platforms only.)
1–13
Progress DataServer for ODBC Guide
Progress
Schema DataServer
Holder Client
Server
Host (-H)
ProControl
Utilities
ProBroker
Data
Data Source DataServer
Source Name Server-n
1–14
Introduction
however, you can optionally locate it on any host that is accessible on your network. Each
spawned DataServer can service database requests for the same database or for a different
database than those of other spawned servers.
In remote DataServer configurations, Progress handles the communication between the client
and the server. The client and server processes that make up the DataServer adapt to a variety
of network configurations.
• AppServer
• Database
• NameServer
• WebSpeed Messenger
• WebSpeed Server
• Create new instances of Progress servers and configure their property settings
1–15
Progress DataServer for ODBC Guide
For more information about working with the Progress Explorer tool, see the Progress Explorer
online help.
The Progress client runs on a client machine (either Windows or UNIX) and accesses a remote
server on any supported DataServer for ODBC platform. Multiple NameServers and/or brokers
may be running simultaneously on one server machine. The DataServer client connects to a
broker for the Progress Explorer either directly or through a controlling NameServer. (See the
important caution that follows.) It is then automatically reconnected to an Enterprise DataServer
established for it by the broker. Each executing broker may spawn a multitude of DataServer
processes. A spawned DataServer process uses ODBC drivers to locate and connect to a data
source. Depending on the ODBC and data-source software implementation, the actual target
database might be either local or remote to the host machine. Note that in this example, the
schema holder also runs on the Windows client; however, you can optionally locate it on any
host that is accessible on your network. Each spawned DataServer can service database requests
for the same database or for a different database than those of other spawned servers.
In remote DataServer configurations, Progress handles the communication between the client
and the server. The Progress Explorer supports only the TCP/IP network configuration.
CAUTION: In a run-time configuration, all DataServer clients should attach consistently
either to a set of NameServers or to a set of brokers. Do not run brokers under
controlling NameServers for one client while another client simultaneously
attaches directly to a broker.
For more information about configuring and connecting the DataServer, see the following
sections:
• “Starting and Stopping a Broker Process from the Progress Explorer and Connecting a
Client” in Chapter 4, “Connecting the DataServer”
1–16
Introduction
1.5.1 DB2
Progress-supplied software:
• WebSpeed Transaction Server Version 3.0 or later or Progress Version 9.0 or later
• DB2/MVS
• DB2/NT
• DB2/6000
ODBC software:
• IBM DB2 Driver supplied with Client Access Enabler or the Merant Data Direct ODBC
Driver.
• For the Personal DataServer, MERANT DataDirect ODBC driver can be purchased and
installed alternatively over the driver supplied with IBM’s Client Application Enabler.
However, installation of the Client Application Enabler is still required.
• For the Enterprise DataServer, Progress supplies the ODBC driver, which is automatically
installed when you install the ODBC DataServer. See the DataDirect Connect ODBC
Reference on the Progress CD for additional information.
1–17
Progress DataServer for ODBC Guide
1.5.2 Informix
Progress-supplied software:
• WebSpeed Transaction Server Version 3.0 or later or Progress Version 9.0 or later
• Informix Connect (required only if the DataServer for ODBC machine is remote to the
data source)
ODBC software:
• For the Personal DataServer, MERANT DataDirect ODBC driver can be purchased and
installed separately. For information on exact driver version compatibilities with the
Informix data-source client software and ODBC software, see the MERANT Web Site at
www.merant.com.
• For the Enterprise DataServer, Progress supplies the ODBC driver, which is automatically
installed when you install the ODBC DataServer. See the DataDirect Connect ODBC
Reference on the Progress CD for additional information.
• WebSpeed Transaction Server Version 3.0 or later or Progress Version 9.0 or later
Data-source software:
• Microsoft Access
1–18
Introduction
ODBC software:
• For the Personal DataServer, Microsoft ODBC Desktop Database drivers can be
purchased and installed separately. For information on exact driver version compatibilities
with the Microsoft Access client and server data-source software, see the Microsoft Web
Site at www.microsoft.com.
• For the Enterprise DataServer, Progress supplies the ODBC driver, which is automatically
installed when you install the ODBC DataServer. See the DataDirect Connect ODBC
Reference on the Progress CD for additional information.
• WebSpeed Transaction Server Version 3.0 or later or Progress Version 9.0 or later
• Net-Library interface drivers for Microsoft SQL Server (required only if the DataServer
for ODBC machine is remote to the data source)
For information on exact driver version compatibilities with the Microsoft SQL Server
client and server data-source software, see the Microsoft Web Site at www.microsoft.com.
ODBC software:
• For the Personal DataServer one of the following can be purchased and installed
separately:
For information on exact driver version compatibilities with the Microsoft SQL Server
client and server data-source software, see the Microsoft Web Site at www.microsoft.com.
1–19
Progress DataServer for ODBC Guide
• For the Enterprise DataServer, Progress supplies the ODBC driver, which is automatically
installed when you install the ODBC DataServer. See the DataDirect Connect ODBC
Reference on the Progress CD for additional information.
1.5.5 Sybase
Progress-supplied software:
• WebSpeed Transaction Server Version 3.0 or later or Progress Version 9.0 or later
• Open Client Library, DCE version (required only if the DataServer for ODBC machine is
remote to the data source)
ODBC software:
• For the Personal DataServer, MERANT DataDirect ODBC driver can be purchased and
installed separately. For information on exact driver version compatibilities with the
Sybase data-source client software and ODBC software, see the MERANT Web Site at
www.merant.com.
• For the Enterprise DataServer, Progress supplies the ODBC driver, which is automatically
installed when you install the ODBC DataServer. See the DataDirect Connect ODBC
Reference on the Progress CD for additional information.
1–20
Introduction
The DataServer allows you to use Progress features as extensions to your data source. Some of
the Progress programming and database design techniques that you can implement on your
ODBC data source using the DataServer are:
• ROWID function
• Arrays
• Case-insensitive indexes
For access to some of these features, you might have to make minor modifications to how your
ODBC data source or application is organized. For a discussion of these issues and instructions
for modifying your data source, see Chapter 2, “Programming Considerations.”
If you create an ODBC data source from an existing Progress database with the
Progress-to-ODBC migration utility and select the Create Extended 4GL Objects option, you
can use the FIND PREV/LAST statements, and case-insensitive indexes with the resulting
ODBC data source, in addition to taking advantage of Progress-like cursor behavior.
How you use the DataServer depends on whether you plan to access information in a data source
through a Progress application, migrate a Progress database to an ODBC data source, or upgrade
to the Version 9 DataServer for ODBC. The following sections summarize what you must do
and point you to the information you need in this manual.
1.6.1 Using the DataServer for ODBC for the First Time
You must make these preparations before using the DataServer:
2. For the Personal DataServer, purchase and install the ODBC driver software.
For the Enterprise DataServer, the ODBC driver software is automatically installed when
you install the DataServer software on the machine that will execute the server component.
3. Create a local schema holder on the client or server machine, as appropriate. Schema
holders cannot be transferred between different host machines.
1–21
Progress DataServer for ODBC Guide
1. Install the DataServer components on the machines that your configuration requires.
2. Run the Progress-to-ODBC migration utility selecting the appropriate supported data
source for migration.
See the “Migrating a Progress Database to an ODBC Data Source” section in Chapter 5, “The
DataServer Tutorial,” for specific instructions.
1. Install the Version 9 DataServer modules on the machines that your configuration
requires.
2. Create an empty Version 9 local schema holder on the client machine or the server
machine, as appropriate.
3. Upgrade Version 8 schema holders to Version 9 by dumping data definitions from the
Version 8 schema holder and loading them into new empty Version 9 schema holder.
See Chapter 3, “Configuring the DataServer,” for information about where to install DataServer
modules and how to create a schema holder. For more information on upgrading your
DataServer, see Appendix A, “Upgrading DataServer Applications.”
1–22
Introduction
Table 1–4 lists manuals from the Progress and WebSpeed documentation sets that contain
useful information on different aspects of DataServer usage.
1–23
Progress DataServer for ODBC Guide
1–24
2
Programming Considerations
• Database design issues including database objects, naming conventions, limitations, code
pages, indexes, views, triggers, and sequences
• Application issues including data types (user defined, arrays, unknown values, zero-length
character string), record creation and record locking, transactions, error handling, and
cursors
• Progress 4GL issues including the COMPILE statement, field lists, the FIND statements,
the ROWID and RECID functions, as well as 4GL statements and functions that the
DataServer does not support
• Stored procedures including running native stored procedures from a Progress procedure,
retrieving return codes, setting parameter values, defining buffers and receiving database
results, and sending SQL directly to the data source
Follow these guidelines carefully when you develop your application to ensure that it can access
Progress databases and ODBC data sources transparently.
The material in this chapter is also of interest to users who plan to migrate a Progress database
to an ODBC data source. However, such a migration raises additional issues that you must
consider when designing your application. For details, see the “Running the Progress-to-ODBC
Utility” section in Chapter 5, “The DataServer Tutorial.”
2–2
Programming Considerations
Sybase,
Microsoft Microsoft
Progress DB2 Informix
Access SQL Server
6.5
Unique index Unique key Primary key Primary key Primary key
2–3
Progress DataServer for ODBC Guide
Sybase,
Microsoft Microsoft
Progress DB2 Informix
Access SQL Server
6.5
2–4
Programming Considerations
Alphanumeric A-Z or a-z A-Z or a-z A-Z or a-z A-Z or a-z All alphanumeric
characters 0-9 0-91 0-9 0-9 characters from the
character set that
you defined for
your Microsoft
SQL Server or
Sybase database
2–5
Progress DataServer for ODBC Guide
Keywords Not allowed5 Not allowed5 Allowed but not Not allowed5 Not allowed5
recommended5
2–6
Programming Considerations
GUI Monitor
and
Keyboard
Data
source
Native
Data source data Data Client
ODBC
iso_1 source Server iso8859-1
interface
indicates that a
code-page conversion SH
can occur at this iso8859-1
location
2–7
Progress DataServer for ODBC Guide
In the configuration shown in Figure 2–1, all components use the same code page. (For
information on setting character sets for your data source, see the administration guide supplied
by the vendor.) On the Progress side, if the client and the schema holder use different code
pages, a conversion takes place between them.
In order for DataServer applications to manipulate data from an ODBC data source accurately,
you must specify the correct code page in the schema holder. For Progress applications
accessing the DataServer, the schema holder identifies the code page of the character data. The
DataServer sends the data-source name for the code page to the data source to indicate the
character set for the data that the data source returns.
Be sure to set the code page in the schema holder to match a code page that the ODBC data
source supports. To minimize the number of translations, specify the default code page that the
data source uses. If Progress does not support the data source’s code page, you can specify
instead a compatible code page that is available for your data source. The directory
$DLL/prolang/convmap contains conversion tables for all of the code pages that Progress
supports. Check to see whether any of them match your code page.
The default code page setting in the schema holder is iso8859–1/iso_1. You can specify a
different code page for the schema holder at the following times:
• When you create the DataServer schema for the ODBC data source.
• When you load a new schema with a specified code page into an existing schema holder.
In this case, the newly loaded schema’s code page overrides the schema holder’s original
code page.
NOTE: It is possible to change the code page at other times; for example, by using edit
programs. However, because changing the code page does not affect the data already
in the database, writing new data to your database using a different code page can
corrupt the data in your database.
When you specify the code page, you must supply both its Progress and its ODBC data-source
name using the format <Progress name/ODBC name>; for example, iso8859–1/iso_1 (this is
the default code page). If you specify only the Progress name, the DataServer attempts to supply
the data-source name for you. If you supply an incorrect data-source name, the DataServer does
not detect the error until run time when the connection to the data source is made, and the
connection fails.
2–8
Programming Considerations
You can specify the code-page name as undefined to prevent any conversions from taking
place, but you should do this only after determining that a single code page is used throughout
your environment, including by the ODBC data source.
NOTE: You cannot use the PROUTIL utility to change the code page used by the
DataServer.
Keep in mind that your ODBC software configuration might have local requirements for
defining the proper language interface between the ODBC drivers and the data source. See your
ODBC and database documentation for details.
Sybase returns records with columns that begin with a tilde character but no alphanumeric
records, since ASCII character 126 is sorted below alphanumeric characters in this Sybase
collation.
2–9
Progress DataServer for ODBC Guide
Normally, the default Progress collation sorts a tilde character above all alphanumeric
characters. Therefore, in order for the above example to exhibit Progress-like behavior and
return alphanumeric records as well as records beginning with the tilde, the Sybase sort order
for this code page would need to be modified accordingly.
Conversely, if you execute the opposite:
Sybase returns records with columns that began with a tilde character followed by all that begin
with alphanumeric characters. However, the default Progress collation, which sorts the tilde
higher than all the alphanumeric characters, would omit records beginning with alphanumeric
characters and only return records beginning with the tilde character.
To get the full result set returned from Sybase from the Progress client would require modifying
the collation table associated with the Progress code page and weighting it to match the Sybase
sort order.
For a complete discussion of how Progress handles code-page issues, see the Progress
Internationalization Guide.
2.1.5 Indexes
You create and maintain all indexes from within the ODBC data source, using native
data-source tools rather than with the Progress Data Dictionary. A data-source index uses a
logical pointer to the physical locations of table rows in order to sequence data access. You can
add and drop indexes but you cannot use their names in queries. The data source alone
ultimately decides when and how to use indexes; its decisions are not affected by the
DataServer.
Using index definitions in the ODBC data source, the DataServer builds index information in
the schema holder. Progress index definitions for the data source schema serve two purposes:
• They allow you to use the OF option in Progress with the FOR EACH and FIND
statements. Using the OF option improves the readability of your code. The OF keyword
is equivalent to the SQL WHERE clause. You can use OF only when you have a field of
the same name in two tables and the field is an index in at least one of the tables. Therefore,
since the cust-num field is common to both the order and customer tables, you could write
the following statement:
2–10
Programming Considerations
• They support the Progress USE–INDEX option. Progress translates USE–INDEX to SQL
ORDER BY for DataServer operations. For example, if you define city-dept as an ODBC
data-source primary key on the city and department fields, it is a unique index in the
schema holder. In this case, the following Progress statements are equivalent when
accessing the data source:
NOTE: If you do not specify USE–INDEX or ORDER–BY, your query will return
records in an unpredictable order. Your application might not require predictable
ordering, but if it does, be sure to include USE–INDEX or ORDER–BY in your
query definition.
Unique Indexes
If your ODBC data-source tables have at least one unique index, they can be used to support
operations such as backward and forward scrolling and accurate cursor positioning through the
FIND CURRENT, PREV, and LAST statements. If a table does not have a unique index, you
can scroll only forward through its data.
If an ODBC data-source table does not have a unique index, you can designate an index to serve
as the unique index for the schema holder. An index that you designate as unique in the schema
holder must be unique with respect to the data in the data source, otherwise you receive run-time
errors. See Chapter 5, “The DataServer Tutorial,” for instructions on using the Progress Data
Dictionary to designate unique indexes.
2–11
Progress DataServer for ODBC Guide
ODBC data-source views and result sets from stored procedures do not have unique indexes.
Just as for tables, you can use the Progress Data Dictionary to create a unique index in the
schema holder based on fields in a view or result set so that you can browse data accessed
through views or stored procedures.
NOTE: Do not change the designated ROWID key of a record while an application is
running. Suppose, for example, that cust-num is a unique key and has been
designated the Progress ROWID. If a user changes the value of cust-num for a
customer from 1 to 111, other users receive an error message when they try to access
the record for customer 1.
• Progress considers the user ID and password submitted at connection time to be case
sensitive.
If an indexed field is case insensitive, Progress does not distinguish between uppercase and
lowercase letters for that index when sorting or matching data. In general, this flexibility in an
application makes data entry easier for end users because they can enter lowercase or uppercase
versions of an index. However, if you want to enforce an uppercase/lowercase distinction in
your applications, set the attribute to case sensitive.
The DataServer makes this feature compatible across Progress and ODBC data sources. Case
insensitivity for indexes is particularly useful when migrating Progress applications to run with
an ODBC data source. To support it, an extra column must be added to the data source
immediately before the indexed column. In most cases, this column is named _S#_column
(exceptions are noted in the following sections). See the “Adding Extended 4GL Support”
section in Chapter 5, “The DataServer Tutorial,” for instructions on adding this column
automatically with the Pro-to-ODBC utility for Sybase and Microsoft SQL Server 6.5.
2–12
Programming Considerations
Specific ODBC data sources handle case sensitivity as described in the following sections.
DB2
DB2 is case sensitive. Be sure to consider case sensitivity when you perform comparisons
(equals or matches).
Informix
The DataServer assumes case sensitivity since ODBC does not allow you to determine case.
This might affect how records are sorted and the order in which they are returned to the Progress
client. Be sure to consider case sensitivity when you perform comparisons (equals or matches).
In Informix, the column that you add to the data source to support case insensitivity for indexes
is named _S__column rather than _S#_column. This is because Informix does not allow the
pound sign in object names.
Microsoft Access
Microsoft Access is not case sensitive. This might affect how records are sorted and the order
in which they are returned to the Progress client. Be sure to consider case sensitivity when you
perform comparisons (equals or matches).
Sybase
For Sybase, the System Administrator sets case sensitivity at the Sybase level.
2–13
Progress DataServer for ODBC Guide
If a view has a unique combination of columns, you can simulate a unique index using the
Progress Data Dictionary. You can then access a view that has a simulated unique index just as
you do a table; that is, you can scroll backward and forward, and update, create, and delete data,
if the data source supports it. See the “Modifying Field-level Information” section in Chapter 5,
“The DataServer Tutorial,” for information on how to do this.
Some views are the results of joins and contain data from more than one table. You can also
provide unique index information for these views if they have a unique combination of columns.
You can then scroll backward and forward, but the ODBC data source does not allow you to
create or delete data in a multi-table view. You can, however, update data in some views.
The DataServer does not support access to columns in views that are the results of aggregates
or computations unless the calculated column has a name associated with it. You assign a
specific name to a calculated column when you define a data source view. For example, the
following SQL statement names a computed column in a view definition:
If your data source supports views, you can also access those views by using the RUN
STORED–PROC send–sql–statement option to send a SQL statement to select the data from the
view. In this case, you can access the view without adding index definitions for the view to the
schema holder.
Although the schema holder contains your ODBC data-source views, the Data Dictionary’s
SQL View Report does not list them, nor can you access them through the PRO/SQL menu
functions.
2–14
Programming Considerations
2.1.8 Triggers
Triggers are code that an application associates with a data-source object and an action. For
example, writing a record might cause code associated with that object or action to execute. The
DataServer allows an application to execute triggers for both Progress databases (including the
schema holder) and ODBC data sources (if the data source supports triggers). In an application
that executes both types, the Progress trigger (CREATE, FIND, UPDATE, DELETE) executes
first. If processing a Progress trigger results in a data-source request, the DataServer passes the
request to the appropriate ODBC data source and the operation (INSERT, UPDATE, DELETE)
executes.
Triggers for Progress databases and ODBC data sources are independent of each other. A
data-source trigger that rolls back does not affect Progress triggers. Defining a trigger in
Progress does not create a data-source trigger definition. A Progress trigger that rolls back does
so independently of the data source’s transaction scope. Note, however, that although triggers
for Progress databases and ODBC data sources are independent, they might affect each other
based on the kind of transaction that your application is executing.
See the documentation for your ODBC data source to determine whether it supports triggers
and, if so, for information on the kind of triggers it supports.
2–15
Progress DataServer for ODBC Guide
You can also modify these definitions using the Data Dictionary. For example, the DataServer
maps the Sybase tinyint data type to the Progress equivalent, INTEGER. Suppose, however,
that your application uses the tinyint field in such a way that the LOGICAL data type is a more
suitable equivalent. In this case, you would change the data type from INTEGER to LOGICAL
in the schema holder. If you do change a data-type mapping, be sure to select a data type that
accommodates the data in the column, otherwise conversion errors might occur at run time.
Also, remember to specify a display format that is appropriate for the new data type. See the
“Modifying a Schema Holder” section in Chapter 5, “The DataServer Tutorial,” for an
explanation of how to use the Data Dictionary to change Progress data types in the schema
holder.
The tables in the following sections list, for each ODBC data source, the data types supported
by the DataServer, the ODBC SQL equivalents, and the default Progress equivalents. The notes
that follow some tables provide additional information.
DB2
Table 2–3 lists the DB2 data types supported by the DataServer, their ODBC SQL equivalents,
and their default Progress equivalents. The data types in parentheses are alternative data types
that you can specify in the schema holder for your DB2 data source. You cannot change the list
of default data types in a schema holder for a DB2 data source.
2–16
Programming Considerations
Informix
Table 2–4 lists the Informix data types supported by the DataServer, their ODBC SQL
equivalents, and their default Progress equivalents.
2–17
Progress DataServer for ODBC Guide
Microsoft Access
Table 2–5 lists the Microsoft Access data types supported by the DataServer, their ODBC SQL
equivalents, and their default Progress equivalents. The data types in parentheses are alternative
data types that you can specify in the schema holder for your Microsoft Access data source.
2–18
Programming Considerations
2–19
Progress DataServer for ODBC Guide
Sybase
Microsoft SQL Server 6.5
Table 2–6 lists the Sybase and Microsoft SQL Server data types, their ODBC SQL equivalents,
and their default Progress equivalents. The data types in parentheses are alternative data types
that you can specify in the schema holder for your Sybase or Microsoft SQL Server data source.
Table 2–6: Sybase and Microsoft SQL Server 6.5 Data-type Equivalencies (1
of 3)
Sybase or Microsoft
SQL Server 6.5 SQL-ODBC Data Type Progress Default
Data Type
2–20
Programming Considerations
Table 2–6: Sybase and Microsoft SQL Server 6.5 Data-type Equivalencies (2
of 3)
Sybase or Microsoft
SQL Server 6.5 SQL-ODBC Data Type Progress Default
Data Type
2–21
Progress DataServer for ODBC Guide
Table 2–6: Sybase and Microsoft SQL Server 6.5 Data-type Equivalencies (3
of 3)
Sybase or Microsoft
SQL Server 6.5 SQL-ODBC Data Type Progress Default
Data Type
2–22
Programming Considerations
2.2.2 Arrays
The Progress database allows you to define fields as arrays, also called field extents. Progress
interprets specially named data-source columns of the same data type as a Progress field with
the same number of array elements. You must name the data-source columns column-name##1,
column-name ##2, and so forth. In Informix, however, you must name these columns
column-name__1, column-name __2, and so forth. (Informix does not allow the pound sign
(hash sign) in object names.) The DataServer creates a single field definition in the schema
holder for the field extents. See the “Adding Extended 4GL Support” section in Chapter 5, “The
DataServer Tutorial,” for instructions on adding these columns automatically with the
Progress-to-ODBC utility.
See the documentation for your data source to determine whether it supports null values.
A column that is not allowed to hold the unknown value is marked “mandatory” in the schema
holder.
2–23
Progress DataServer for ODBC Guide
In a DataServer application, you assign the unknown value to a column in an ODBC data source
by using the question mark operator (?), which the DataServer translates to the appropriate
null-value representation for the data source. For example, the following procedure assigns the
unknown value to the address2 field of the customer table:
2–24
Programming Considerations
Although “” and “ ” evaluate the same way in a WHERE clause, they have different results when
you use them with the BEGINS function. For example, the following statement retrieves all
customer names except those that have the unknown value:
The following statement uses “ ” to retrieve only those names that begin with a space:
The following statement is not meaningful to an ODBC data source. It generates the error
message “Illegal operator for unknown value or zero length character string:”
This restriction has been relaxed for columns of the DATE data type. For example, the
following statement is valid:
DB2 considers all zero-length character strings as equal to a single space. Therefore, DB2
considers “” and a string of blank spaces to be effectively the same thing.
DO TRANSACTION:
CREATE customer.
name = "SMITH".
cust-num = 10.
address = "1 Main St".
END.
2–25
Progress DataServer for ODBC Guide
• Progress does not create the record at the CREATE statement. Instead, it writes it to the
database at the end of the record scope or when the index information is supplied,
whichever occurs first. In this example, Progress writes the record after executing the
statement cust-num = 10.
• The DataServer writes the record at the end of the record scope. In this example, it writes
the record after executing the statement END.
The following procedure also illustrates the differences between Progress and DataServer
record creation:
In this procedure, the code creates a customer, sets cust-num equal to 111, then finds and
displays the customer record using cust-num (the unique index). In this case:
• The DataServer fails to find customer 111 because it has not yet written the record for
customer 111 to the data source.
To get a consistent response from the DataServer, use this procedure instead:
The VALIDATE or RELEASE statement causes the DataServer to write the customer 111
record to the database before the FIND statement occurs.
NOTE: If you set the default value when creating a record, you must change the value before
you create another record with the default value if the field is part of a unique key.
Otherwise, the second record will cause a duplicate key.
2–26
Programming Considerations
Record updates are handled similarly to record creation. A record is updated in an ODBC data
source at the end of record scope or at the end of a transaction, whichever comes first. For
example, when you run the following procedure, the newly updated record is not found:
To send the record to the data source sooner, use the VALIDATE statement, as follows:
For more information about record scoping and transaction behavior, see the Progress
Programming Handbook.
SHARE–LOCK May support shared locks at the table, page, and record level.
However, the scope and duration of Progress and data-source
shared locks may differ depending on how data source cursors
behave at a transaction boundary and how isolation levels are set.
For more information, see your data source documentation.
2–27
Progress DataServer for ODBC Guide
EXCLUSIVE–LOCK Can support exclusive locks at the table, page, and/or record level,
depending on the data source.
1
DB2 does not support an equivalent lock type. In a DB2 application, the Progress NO–LOCK condition option
is the equivalent of a Progress SHARE–LOCK option. As a result, you might receive the message “record
locked.”
2
Sybase and Microsoft SQL Server 6.5 support the NO–LOCK option in a manner consistent with Progress
except for indexed columns. Record-level locking remains in effect when you access indexed columns.
Each data source uses locks or optimistic concurrency control automatically to isolate users
from each other in a multi-user configuration. Your data source and ODBC driver may provide
one or a number of transaction isolation levels. In a multi-user configuration, you can isolate
users from each other in your data source by setting the isolation level (if the ODBC driver
permits). In your Progress schema holder, use the -Dsrv TXN_ISOLATION,n connection
parameter (where n = 1, 2, 4, or 8) to set the isolation level in ODBC. See the Microsoft ODBC
Programmer’s Reference for more information and the reference manuals provided by your
data source vendor for supported isolation levels.
NOTE: Certain earlier versions of DB2, Sybase, and Microsoft SQL Server 6.5 use
page-level locking rather than record-level locking. This can affect data access when
two or more users attempt to read or update different records that are on the same
page. See your data-source documentation for details.
2–28
Programming Considerations
• It puts some form of shared lock on the record, page, or table if the ODBC isolation level
is anything other than read uncommitted. This occurs regardless of whether the share lock
is specified in the Progress 4GL statement.
• After the data source reads the record, it releases the shared lock if the isolation level is
read uncommitted or read committed. It may hold share locks until the completion of a
transaction if the isolation level is repeatable read or serializable.
If a record has a shared lock on it, other users can usually access that record and apply a shared
lock, but this is dependent on the isolation level and DataServer locking behavior. Refer to the
transaction and locking references in the Microsoft ODBC Programmer’s Reference or data
source reference manuals for more information.
DO TRANSACTION:
FIND customer WHERE cust-num = 10.
UPDATE customer.
END.
2–29
Progress DataServer for ODBC Guide
• When you access a Progress database with this procedure, the customer record is
share-locked when the first transaction ends.
• When you access an ODBC data source with the DataServer, the customer record is
released when the first transaction ends.
This example illustrates how Progress and ODBC data-source shared locks differ in scope and
duration:
tx:
DO TRANSACTION ON ERROR UNDO tx, RETRY tx:
FIND customer WHERE cust-num = 10 EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
IF LOCKED customer THEN DO:
Message "customer locked - retrying".
UNDO tx, RETRY tx.
END.
ELSE DO:
ASSIGN customer.
LEAVE.
END.
END.
END.
In this example, the first record is only share-locked within the ODBC data source if the
isolation level setting requires it. (Recall that a share lock specified in a Progress statement is
ignored by the DataServer.) As a result, the first record might be updated before the second
FIND statement executes, in which case the record that the second FIND statement fetches
might be different from the record fetched by the first FIND statement. This procedure might
cause update information to be lost because the procedure applies updates based on the first
record, and these updates will overwrite the values in the second record.
2–30
Programming Considerations
Using the DataServer to access an ODBC database ensures that locks are upgraded in the data
source in the same way as in a Progress database. For example, the following procedure causes
the same behavior whether you access a Progress database or an ODBC data source:
DO TRANSACTION:
ASSIGN customer.
END.
The record is share-locked when it is fetched. The DataServer upgrades the shared lock to an
exclusive lock inside the transaction by locking the record, reading it, and checking whether the
record has changed since it was first fetched. If it has changed, the lock upgrade fails and you
receive an error message.
If your data source uses record-level locking, you might have to wait to access a record in the
following circumstances:
• You try to update a record when another user is reading it (it is share-locked). This also
depends on the isolation level.
• You try to read or update a record when another user is updating it (it is exclusive-locked).
When this happens, Progress uses a time-out loop, checking periodically to see whether the
record is available. You can choose Cancel at any time to abort the request.
The ODBC data source notifies the DataServer if it cannot perform a requested operation within
a given period of time. Under unusual system or network loads, the DataServer might receive
notification that a request has not been completed. In this case, it returns a message that the
record that the request was accessing is locked, even though no other user has a lock on the
record.
One type of locking behavior that you might encounter is a deadlock, or “deadly embrace.” A
deadlock occurs when two users want to access each other’s table, page, or record, and either
the table, page, or record that they want has an exclusive lock on it or they need to put an
exclusive lock on it. Neither table, page, or record will give up its lock until the other is
available. When an ODBC data source detects this situation:
2–31
Progress DataServer for ODBC Guide
• The data source kills the transaction that has accumulated the least amount of CPU time
and releases the table, page, or record for the other user.
NOTE: On DB2 for AIX, the DBA must set the variable LOCKTIMEOUT to some number
of seconds in the database configuration to get beyond a deadlock condition. The
default value (-1) causes a user to wait indefinitely for a lock to be released when
attempting to update a locked record.
For details on how Progress locks work, see the Progress Programming Handbook. See ODBC
and data-source documentation for more information about ODBC and data-source locks.
DB2
DB2 does support the NO–WAIT option when the LOCKTIMEOUT option is set to zero.
Informix
Informix supports the NO–WAIT option by providing an equivalent NOT WAIT option.
Microsoft Access
Microsoft Access does not support the NO–WAIT option; if you include this option in a
statement, it is ignored.
Sybase
Microsoft SQL Server 6.5
The NO–WAIT option works for DataServer applications in the same way that it works for
Progress applications: the DataServer uses a time-out mechanism. If Sybase or Microsoft SQL
Server 6.5 does not return a record within a set period of time, the DataServer considers the
record to be locked. It then cancels the request to Sybase or Microsoft SQL Server 6.5 and sets
the “locked” and “not available” conditions.
During a period of heavy demand, you might encounter situations where the “not available”
condition is set although the record is not currently locked by a user. In this case, you might want
to increase the time-out interval by using the -Dsrv RESP_TIMEOUT parameter.
2–32
Programming Considerations
2.5 Transactions
With DataServer operations, an ODBC data source handles its own transaction roll back and
recovery operations. However, if the ODBC driver supports transaction processing, the
Progress transaction scoping rules apply: a transaction ends when the code exits the outermost
block that performs an update. With the DataServer:
• When a transaction that updates an ODBC data source ends successfully, Progress sends
a COMMIT to the data source.
• If you interrupt the transaction, Progress sends a ROLLBACK to the data source.
See the Progress Programming Handbook for details on how Progress handles transactions and
error conditions.
2–33
Progress DataServer for ODBC Guide
rep-blk:
REPEAT:
PROMPT-FOR customer.cust-num. /* User input */
FIND customer USING cust-num NO-ERROR.
IF AVAILABLE customer THEN
UPDATE customer.cust-num name customer.state. /* User input */
do-blk:
DO ON ERROR UNDO do-blk, RETRY do-blk:
FIND state WHERE st.state = customer.state.
DISPLAY state.
SET state. /* User input */
END.
END.
This procedure displays the following screen, in which the user is prompted to enter data into
the Cust-Num field and then the State field:
2–34
Programming Considerations
If you use NO–ERROR to do your own error handling, you must account for the fact that an
ODBC data source creates or updates a record later than Progress does. For example, the
following code does not trap data-source errors, because the requests to perform the operations
have not yet been sent to the data source:
The VALIDATE statement causes the DataServer to send requests to your ODBC data source,
so incorporate it into your error-handling technique, as in the following example:
2–35
Progress DataServer for ODBC Guide
2.7 Cursors
A cursor is like a pointer that points to consecutive records in a table. Progress uses cursors to
keep track of where it is in a table; for example, when it processes FOR EACH statements.
Suppose that you are reading records from the customer table using the cust-num index, and
your current record is customer number 50. This means that Progress has a cursor positioned at
cust-num 50. Note that Progress maintains cursor positioning across equivalent FIND
statements.
The DataServer allows applications that access ODBC data sources to imitate Progress cursor
behavior for FIND cursors. FOR EACH and OPEN QUERY statements do not retain cursor
position across other queries or against a FIND statement.
2–36
Programming Considerations
The DataServer supports the ROWID function for ODBC data-source tables that have a unique
index. The Progress Data Dictionary uses an index that meets this criterion to provide values for
the ROWID function. If you build your schema holder using Progress compatibility from the
Progress-to-ODBC utility, the Progress Data Dictionary automatically designates a ROWID
index; however, you can select a different unique index in a data-source table to support
ROWID. See the “Defining the ROWID” section in Chapter 5, “The DataServer Tutorial,” for
instructions.
The ROWID value in an ODBC data source differs from the ROWID value in a Progress
database in the following ways:
CREATE customer.
a=ROWID(customer).
The DataServer creates a customer record using default values. After the user assigns
values to the fields in that record, the DataServer updates it. When you UNDO the
transaction, the DataServer deletes the record.
• The ROWID changes if the value of the unique keys in the designated index changes.
• If you force the creation of a record before entering the value for the designated column
(for example, by committing a transaction or releasing or validating a record), the creation
fails if the column cannot have NULL values. If the column can have NULL values, the
DataServer assigns the new record a ROWID of NULL. However, if the column has an
initial value, the DataServer creates the row with that initial value as the ROWID.
2–37
Progress DataServer for ODBC Guide
Follow these guidelines when using ROWID in applications that you want to deploy across
multiple Progress databases and/or ODBC data sources:
• Do not try to get a record’s ROWID value before the user assigns values to the unique keys
of the record. Some DataServers use the unique key to generate a ROWID value.
• Refresh the ROWID value if a value of a unique key might have changed.
• Refresh the ROWID value after you undo a DELETE. The ROWID value might be
different after the record is re-created.
• ROWID values are stable for a session, but you cannot rely on them to be the same across
sessions.
For a complete description of the ROWID function, see its reference entry in the Progress
Language Reference.
2–38
Programming Considerations
DEFINE QUERY myquery FOR customer FIELDS (cust_num name) SCROLLING NO-LOCK.
Include the SCROLLING option to enable GET PREVIOUS. You must include the NO–LOCK
option when you open queries that are defined with field lists.
Similarly, you must include the NO–LOCK option in FOR EACH statements that include field
lists, as in the following example:
Field lists are effective only when you also specify the NO–LOCK option. This option ensures
that the DataServer does not have to refetch rows, which can slow performance.
Use field lists to retrieve only those fields that your application requires. (For performance
reasons, the DataServer retrieves the first index field even if you do not include it in the field
list. In cases where the DataServer can predict that a query will require a refetch, it retrieves the
entire record.) The DataServer allocates memory based on the maximum size defined for a field
2–39
Progress DataServer for ODBC Guide
in a record. Omitting larger fields from a query can enhance performance. In addition,
combining lookahead cursors and field lists especially improves a query’s performance.
When you specify a field that has an extent, the query returns the entire array.
When the DataServer processes a query with a field list, it caches the fields that are part of the
field list and any other fields that the query specified, which you can then access without making
another call to the ODBC. For example, the DataServer fetches the name and the zip field to
process the following query:
NOTE: Cached fields might have performance implications if you modify the record later,
as the DataServer must refetch the record to place a lock on it.
If you specify a field list in a join, you might have to adjust the cache size for lookahead cursors,
either with the CACHE–SIZE option in a QUERY–TUNING phrase or at the session level with
the -Dsrv qt_cache_size startup parameter.
Any performance gained through field lists is lost if you use nonlookahead cursors.
See the Record Phrase entry in the Progress Language Reference for more information on the
FIELDS option.
2–40
Programming Considerations
For example, the procedure find.p accesses Progress databases and ODBC data sources using
the same FIND and FIND PREV statements in each case:
find.p
When you run find.p with a Progress table and a data-source table, you get these results
(assuming that the database has records for customer numbers 1 through 4):
2 2
If the FIND PREV statement fails, the cursor remains located after customer.cust-num 3 in the
Progress table, which was the last record scanned. In the data-source table, the cursor is
positioned at cust-num 2. Failed finds do not affect cursor position in data-source tables.
• A FIND NEXT statement refers to a previous FIND statement if the WHERE clauses in
both statements are identical.
• If the WHERE clauses are different, or if one of the statements does not have a WHERE
clause, the FIND NEXT statement behaves like a FIND FIRST statement.
2–41
Progress DataServer for ODBC Guide
R-code
Progress generates r-code when it compiles a 4GL procedure. The compiled r-code is portable
among machines. For example, code that you compile on a Sun machine can run on any other
UNIX machine. R-code is also compatible across platforms. See the Progress Portability Guide
for information on designing compatible user interfaces for applications.
R-code is not portable among windowing systems; that is, r-code compiled for a character
application will not run under Windows and r-code compiled for Windows will not run under a
character application.
R-code is also not portable among database management systems. Progress generates calls that
are specific to a database. For example:
• Code that you compile for a database named sports will not run with a database named
mysports.
• Code that you compile for Sybase will not run on Informix.
The size of r-code grows when you compile procedures against an ODBC data source as
compared to compiling against a Progress database. The r-code for a DataServer application
contains as text the portions of SQL statements that the DataServer passes to the data source.
2–42
Programming Considerations
– You connect to the schema holder for a DB2, Informix, Microsoft Access, Sybase,
or Microsoft SQL Server 6.5 data source in read-only mode.
• If your ODBC data-source table does not include the columns necessary for supporting
the RECID function, DBRESTRICTIONS also returns RECID.
See the DBRESTRICTIONS function reference entry in the Progress Language Reference for
information on syntax.
2–43
Progress DataServer for ODBC Guide
Table 2–8 summarizes the 4GL differences between Progress databases and ODBC data
sources.
Table 2–8: 4GL Differences for Progress Databases and ODBC Data Sources
(1 of 2)
BEGINS operator When you use these 4GL elements to access data
Abbreviated Index in an ODBC data source, you might get different
USING option results than from a Progress database. Suppose,
for example, that you have customers named SI
and SIM and that you issue this find statement:
MATCHES function The DataServer does not support using the percent
BEGINS function (%) or underscore (_) character with the
MATCHES and BEGINS functions. Do not use
these functions with a pattern that is not an
expression, but is stored in an ODBC data source.
It is theoretically possible to do this with a
Progress database, but using this kind of criteria
results in poor performance.
2–44
Programming Considerations
Table 2–8: 4GL Differences for Progress Databases and ODBC Data Sources
(2 of 2)
SETUSERID function You cannot use this function to change the login
name and password of an ODBC data source.
1
For more information, see the “Data Source Record Locking” section.
2–45
Progress DataServer for ODBC Guide
2–46
Programming Considerations
Stored procedures called from within Progress applications cannot return Boolean types. Table
2–9 lists issues that occur when you pass other data types as parameters.
DECIMAL The DataServer represents all three data types as the Progress
FLOAT INTEGER data type in the schema image. To preserve the scale and
INTEGER precision of these data types, you must manually update the
information in the schema image for these parameters. Use the
Progress Data Dictionary to update the data type and format
information in the field property sheet for the parameter.
CHAR The data source represents this type as a VARCHAR parameter. Its
size cannot exceed the VARCHAR size limit for the associated data
source. If they exceed this limit, they cause an ODBC data-source
error.
DATE If you pass a DATE data type as an input parameter and use it in an
equality test, the test might fail. In this case, use the trunc function in
the stored procedure. For example:
If you are running several stored procedures, run them serially and process all the results from
one stored procedure before you run a second one. The DataServer allows only one active
request for running a stored procedure. However, you can process results from several stored
procedures concurrently if you specify the DataServer startup parameter
(-Dsrv PRGRS_PROC_TRAN) when you start your Progress session. When you run stored
procedures concurrently, the DataServer uses one connection to the data source per procedure.
If the stored procedures attempt to update the same record from a single client’s requests, the
connections could block each other or a deadlock might even occur
NOTE: In your DB2 stored procedure, be sure to code parameters passed into your stored
procedure as variable, not fixed, character strings (with a 2-byte length prefixing the
character value).
2–47
Progress DataServer for ODBC Guide
You run stored procedures from within Progress procedures by using the 4GL RUN
STORED–PROCEDURE statement. A stored procedure that you run with this statement can
return three types of values:
• An integer return code, which could be a success code or a value returned by the stored
procedure (defined by the data source)
• Values of output parameters that you define when you create the procedure
Progress has statements and functions that allow you to use the return codes and the values of
the output parameters. Table 2–10 lists these statements and functions.
Progress Description
Note that you can substitute the abbreviations CLOSE STORED–PROC and RUN
STORED–PROC for the full names CLOSE STORED–PROCEDURE and RUN
STORED–PROCEDURE, respectively. The remainder of this guide generally uses the
abbreviated form.
See Appendix B, “Stored Procedure Reference,” for reference entries for the statements and
functions described in Table 2-10.
Progress provides two techniques for accessing the results returned from the data source by the
stored procedure. You can:
• Use the proc-text-buffer that Progress supplies for the rows of results.
2–48
Programming Considerations
After you read the values into the buffer, you can operate on them in a variety of ways. You can
use the database data just as you would use information from a Progress database—format it
and use it for calculations.
The following sections describe how to do the following:
All of the following examples of how to run stored procedures in Progress use a stored
procedure created in Transact-SQL for Sybase:
CREATE PROCEDURE pcust (@num INT, @orders INT OUT, @states INT OUT) AS
SELECT customer.cust_num, customer.name, order_num FROM customer, order_
WHERE customer.cust_num = order_.cust_num AND customer.cust_num > @num
SELECT @orders = @@rowcount
SELECT cust_num, state.st FROM customer, state WHERE
customer.st = state.st AND customer.cust_num > @num
SELECT @states = @@rowcount
RETURN 0
GO
NOTE: For other ODBC data sources, use your vendor-specific SQL syntax.
This Transact-SQL code creates the stored procedure pcust and defines three parameters: num,
which is an input parameter, and orders and states, which are output parameters. The procedure
returns values for the output parameters to the caller after processing the results of the pcust
SELECT statements. You can think of output parameters as temporary fields; that is, you can
access the data in these columns using the standard notation of tablename.fieldname. (Note that
although pcust is a stored procedure, its syntax is that of a table and it is stored in a table
definition.) For example, you can access the data in the orders and states fields by specifying
pcust.orders and pcust.states. All the parameters in the example have an integer data type.
NOTE: DB2 uses external modules compiled in 3GL languages (for example, C) to
implement stored procedures. Because these languages are often case sensitive, you
must specify in your CREATE PROCEDURE statement a case-sensitive procedure
name that matches the module name exported from the 3GL stored procedure. In the
previous example, the procedure name pcust, which is stored in your dictionary as a
file name that represents the stored procedure to the schema holder, is case sensitive
and must match exactly the case-sensitive module name exported from your DLL.
2–49
Progress DataServer for ODBC Guide
If you perform a schema pull to retrieve a stored procedure from an existing DB2 database,
the procedure name will be imported into your schema holder as all upper case characters
because the DB2 server is not case sensitive and rolls all object names to uppercase. After
inputting the stored procedure, you should go into the Data Dictionary and modify the
procedure name to the appropriate case that matches your 3GL module name. Note that
the DataServer for ODBC caches the schema, which means you will need to disconnect
from the schema holder and reconnect for your procedure name change to take effect.
SYNTAX
SYNTAX
For example, the following Progress 4GL code runs the stored procedure pcust:
This code first defines an integer variable named handle1 that serves as a handle for identifying
the stored procedure. If you have only one active stored procedure, you do not have to specify
a handle. However, it is good programming practice to use handles to identify all of your stored
procedures.
2–50
Programming Considerations
• The pcust stored procedure passes the values 20, 0, and 0 to the three parameters
(specifying orders and states as output parameters).
• Using a FOR EACH statement, it reads the results into the Progress-supplied buffer
proc–text–buffer.
The Progress procedure next uses the CLOSE STORED–PROC statement to fetch the orders
and states output parameters and then displays them. Note that the stored procedure does not
return output parameter values unless you request them with the keyword OUTPUT or
INPUT–OUTPUT when you execute the procedure.
You can close all stored procedures at once with the following statement:
NOTE: For Sybase and Microsoft SQL Server 6.5, the DataServer typically maintains one
connection. If your application requires that you process other queries while a stored
procedure is open, use the -Dsrv qt_separate_connection parameter or the
QUERY–TUNING (SEPARATE–CONNECTION) option to specify that the
DataServer use a separate connection for each statement that requires a cursor.
See Appendix B, “Stored Procedure Reference,” for a description of the complete syntax for the
Progress statements and functions that support running stored procedures.
2–51
Progress DataServer for ODBC Guide
/* Return status */
NOTE: When the DataServer sends a request to execute a native stored procedure, ODBC
assumes that a return code will be received. However, DB2 native stored procedures
do not directly support return codes. Instead, DB2 simulates the use of a return code
for ODBC by inserting an additional output parameter as the first parameter in your
SQLDA structure parameter list. This additional parameter serves as a return value
to the caller. The ODBC DataServer can read a return value properly as long as the
additional parameter is accommodated for in your DB2 native stored procedure.
Place the value you would like to have output as your return code in this first
parameter. It can then be received in Progress with the PROC–STATUS option just
as you would for any other native stored procedure environment. You do not need to
register your stored procedure in the DB2 database with an additional parameter and
doing so would elicit a signature violation at execution time.
2–52
Programming Considerations
The following 4GL procedure uses the second option for passing parameters—it passes them
by name with the PARAM option:
/* Parameters by name */
When you use PARAM to specify parameter names, you do not have to specify all parameters
for the stored procedure. Instead, you can include only those parameters you want to use, in any
order you choose. If the stored procedure names a default value for the parameter, you do not
have to name that parameter at run time. However, you must explicitly name parameters that do
not have defaults or name them when you want to pass values that are different from the default.
• Use the proc–text–buffer that Progress supplies for the rows of results
• Define a special ODBC view on the data source to use as a buffer for the rows of results
The following 4GL procedure reads the database results from the stored procedure into the
proc–text–buffer supplied by Progress:
The Progress-defined buffer, proc–text–buffer, has one character field named proc–text. The
buffer accepts the returned database results, converts them to CHARACTER data type, and
concatenates them into one string. The advantage of using the proc–text–buffer is that you do
not have to worry about what kind of data the procedure returns. The buffer accepts any type of
data, in any order. The disadvantage is that it is much more difficult to manipulate the data after
2–53
Progress DataServer for ODBC Guide
you receive it. To act on anything but CHARACTER data, you must extract the data from the
buffer and convert it to its original data type before you can use it.
Another benefit of the proc–text–buffer is that it holds the results from all of the SQL statements
included in a stored procedure. However, a buffer that you create can hold the results of only
one SQL statement.
This is the partial syntax for the DEFINE BUFFER statement that you use to create a buffer with
the same characteristics of the proc–text–buffer:
SYNTAX
For a complete description, see the DEFINE BUFFER entry in the Progress Language
Reference.
• With the same number of columns and data types that the stored procedure returns in
the results set
• With the columns in the order that the stored procedure returns them
For example, to return two columns with two types of values, an integer and a character
string, use an SQL utility to define the following view in the data source:
2–54
Programming Considerations
Notice that these views are defined to ensure that they never return any results. This
indicates that you will not use the views as views, but as buffers. It is not necessary to
define views that you will use as buffers this way, but it does allow you to distinguish
quickly between views and buffers.
2 ♦ Update your schema image using the Update/Add Table Definitions DataServer utility.
The utility adds the view to the list of accessible objects in the schema holder. The
DataServer defines the view as a buffer that Progress can use.
See the “Updating a Schema Holder” section in Chapter 5, “The DataServer Tutorial,” for
instructions on using this utility.
This buffer defines two returned values for a stored procedure—an INTEGER and a
CHARACTER value—in that order. If the data types do not match those returned by the stored
procedure, the procedure returns more than two types of values, or returns the values in a
different order than you specified, you receive a run-time error.
The easiest way to create a buffer that accepts data from stored procedures is to use the text of
the SQL SELECT statement from the stored procedure. This ensures that you define your data
types correctly and in the correct order. Use a native process such as sp_helptext to view the
stored procedure from Sybase or Microsoft SQL Server 6.5, or view procedures in the system
tables appropriate for your data source.
2–55
Progress DataServer for ODBC Guide
The next example does not use the supplied buffer. Instead, it defines buffers by creating views
in the data source, using the following syntax:
SYNTAX
These are examples of the views, created in your ODBC data source, that you can use as buffers
to store the results from the stored procedure pcust:
The following 4GL procedure shows the results of the stored procedure pcust being written into
the new buffers pcust_orders and pcust_states:
/* Typed buffers */
Because two different buffers have been defined, the returned values maintain their data types
instead of being converted to character strings and stored in the Progress-defined buffer
proc–text–buffer. You can then use the returned values in calculations without first converting
them back to their original data types. In addition, the two separate buffers make your output
look cleaner, allowing Progress to build a new default frame for the two different types of
output. Reading your results into an explicitly defined buffer also allows you to manipulate the
data just as you would manipulate data from a Progress database; for example, with Frame
phrases and FORM statements.
2–56
Programming Considerations
The next example accesses the stored procedure pcust twice; procedure handles (through the
PROC–HANDLE function) identify the different results from your data source:
/* Procedure handles */
In this example, the results look the same as in the previous example. However, because you are
running a stored procedure twice, Progress uses the procedure handles to identify the different
instances. If you run more than one stored procedure in your application, you must explicitly
define procedure handles for each.
The next example shows how to use standard Progress syntax to join the results of the stored
procedures with other tables in the database:
This example joins the order information returned from the stored procedure with the order–line
information in the same database.
2–57
Progress DataServer for ODBC Guide
This example returns the name, address, city, state, and postal code for all customers whose
max–credit is greater than or equal to $500. You must read the results into a buffer as you would
with a stored procedure called by a Progress procedure. You can read the results into the
proc–text–buffer defined by Progress, as in the example above, or you can define your own
buffer from within your data source that accepts a data type other than the CHARACTER data
type.
The following example illustrates returning database results into the proc–text buffer and
converting the results to the INTEGER data type:
2–58
Programming Considerations
The DataServer passes the SQL statement directly to the ODBC data source. The Progress
Compiler does not process it, so errors occur only at run time and not when you compile a
procedure.
2–59
Progress DataServer for ODBC Guide
• For information on tuning queries at compile time and run time, see the “Query Tuning
with Connection and Startup Parameters” section in Chapter 4, “Connecting the
DataServer,”
• Progress 4GL—This approach applies to the DEFINE QUERY and FOR EACH
statements. The DataServer generates SQL for each of these statements. You can use the
QUERY–TUNING option to customize the queries that the DataServer passes to ODBC.
• Progress SQL SELECT—This approach applies to the SQL SELECT statement. When
you use this statement in a Progress procedure, the DataServer passes the SQL directly to
the data source. This can improve performance, especially when counting records, and can
also allow you to access certain types of data more effectively, such as aggregates.
Whether your application can take advantage of the strengths of a particular approach depends
on the kind of query you are writing and the kind of data you are accessing. Another factor to
keep in mind when you decide which technique to use for issuing queries is whether a query is
better served by being processed by the client or by the server. Progress 4GL queries are
processed by the client (except in the cases of most joins); SQL SELECT statements and
vendor-specific SQL extensions are processed by the server (the ODBC data-source manager).
2–60
Programming Considerations
• FOR EACH
SYNTAX
• OPEN QUERY
SYNTAX
• DO PRESELECT
SYNTAX
• REPEAT PRESELECT
SYNTAX
You must place the QUERY–TUNING phrase after the last record phrase. For example, place
it near the end of the statement where you also place block modifier phrases such as BREAK,
ON ERROR, and TRANSACTION.
2–61
Progress DataServer for ODBC Guide
You can include multiple query-tuning options in a single statement; simply separate each
option from the previous one by a single space.
Table 2–11 describes the query-tuning options.
Option Description
ARRAY–MESSAGE Specifies whether the DataServer sends multiple result rows in a single
logical network message, thereby reducing network traffic.
NO–ARRAY–MESSAGE
Default: ARRAY–MESSAGE, if the query uses a lookahead cursor
CACHE–SIZE integer Specifies the size in bytes of the cache used by lookahead cursors. A
larger cache size can improve performance for queries that return a large
number of records because the DataServer might need fewer SQL
statements to get the results.
Minimum: The DataServer always caches at least one record.
Maximum: None
Default: 30000
DEBUG EXTENDED Specifies whether the DataServer should print to the dataserv.lg file
the debugging information that it generates for a query.
DEBUG SQL
Specify DEBUG SQL to print only the SQL that the DataServer executes
NO–DEBUG against the ODBC data source.
Specify DEBUG EXTENDED to print additional information, such as
cursor statistics.
Specify DEBUG option to override the NO–DEBUG default.
In addition to EXTENDED and SQL, there are other options that can
assist you in analyzing performance.
Default: NO–DEBUG
2–62
Programming Considerations
Option Description
SEPARATE–CONNECTION Specifies whether each cursor should use a separate database connection.
Executing cursors in separate connections might improve performance
NO–SEPARATE–
because the DataServer does not have to restart the cursors and sort the
CONNECTION results.
Do not specify SEPARATE–CONNECTION if you require behavior
that is consistent with Progress.
Default: NO–SEPARATE–CONNECTION except in certain cases. For
details, see “Managing Connections to an ODBC Data Source” in
Chapter 4, “Connecting the DataServer.”
2–63
Progress DataServer for ODBC Guide
All but two of the QUERY–TUNING options take effect at both compile time and run time. The
exceptions are JOIN–BY–SQLDB and NO–JOIN–BY–SQLDB, which apply only at compile
time. You can override query-tuning defaults (except JOIN–BY–SQLDB) at run-time by
specifying the appropriate startup parameters.
The following example shows how to use the QUERY–TUNING phrase to enhance
performance. It includes a join that the DataServer instructs the ODBC data source to perform
by default:
• The DataServer writes an extended report on the SQL statements that it executes (the
DEBUG EXTENDED option).
When the DataServer constructs queries for an ODBC data source, it uses the
QUERY–TUNING options that you specify as guidelines. This is because there might be syntax
considerations that prevent the DataServer from applying the QUERY–TUNING options as
specified. In such a case, the DataServer executes the query using the most appropriate options.
NOTE: The DataServer does not issue errors or warnings if it does not apply the
QUERY–TUNING options that you specify.
2–64
Programming Considerations
a row with a defined maximum length of 100 bytes requires 104 bytes of cache. If a
column is longer than 256 bytes, the DataServer refetches it.
In the case of joins, each record in the cache is a result of the fields selected in the join. In
addition to the record, there is a row identifier field (4 bytes) for each table involved in the join.
For example, a three-way join adds 12 bytes to the cache for each record.
You can affect the performance of a query by controlling the size of the cache. As queries
generate different results, they benefit from different cache sizes. Generally, the larger the
cache, the faster the performance. However, you must balance cache size against other memory
requirements for your system. Consider also that continually adjusting cache size in an
application might decrease performance as each adjustment requires the DataServer to make
several calls to the data source.
To determine the optimal cache size for a query, experiment with different values for
CACHE–SIZE and use DEBUG EXTENDED to generate cursor statistics in the dataserv.lg
file that you can examine. Aim for minimal cursor activity. The following example sets an
optimal cache size for a particular query against the Sports database:
• All tables in the join are in the same logical Progress database; that is, they are contained
in the same DataServer schema.
2–65
Progress DataServer for ODBC Guide
• The query does not include a USING phrase for any of the inner tables. For example, a
join by SQL DB will not occur for this query:
• The query does not include a BY phrase that contains expressions or array fields.
• The query does not include a request for an EXCLUSIVE LOCK on any of the tables in
the join.
To estimate whether performing a join by the data source might improve performance, the
DataServer assesses whether these additional criteria are true:
• The join uses an OF clause or a WHERE clause for each of the inner table loops. For
example, the following query requires a field-to-field correspondence between two tables:
• The WHERE clause includes either an operator or the AND option. The following
example includes the equals (=) operator:
The DataServer also performs a join by SQL DB for the following query:
For the following query, however, the DataServer instructs the client to perform the join
because of the OR option:
2–66
Programming Considerations
By default, the DataServer instructs an ODBC data source to perform a join when possible and
when desirable. However, you can control the default behavior by using either the
QUERY–TUNING NO–JOIN–BY–SQLDB phrase or the Server Join (-nojoinbysqldb) startup
parameter. The QUERY–TUNING phrase controls the behavior for a single query. The
-nojoinbysqldb parameter controls it at the session level.
Table 2–12 describes how these controls interact and affect the behavior.
A join by SQL DB does not occur by default for the following query because the DataServer
determines that it does not increase performance:
You receive a warning if you specify JOIN–BY–SQLDB when the ODBC data source cannot
perform the join and the DataServer performs the join instead. You receive a warning at compile
time if you specify JOIN–BY–SQLDB when the data source can perform the join but it is not
optimal for it to do so.
2–67
Progress DataServer for ODBC Guide
• Use FOR EACH, GET, and OPEN QUERY statements rather than FIND statements,
which generally perform more slowly. Consider using the FOR FIRST statement instead
of FIND FIRST.
The only exception is that FIND LAST is faster than GET LAST. This is because GET
LAST causes the client to process all of the records; the FIND LAST statement allows the
server to retrieve the last record.
• Avoid specifying lock upgrades. Instead, allow the DataServer and the ODBC data source
to handle lock upgrades.
• Do not ask for a particular ordering of results with USE–INDEX or BY clauses unless your
application requires it. Instead, allow the DataServer and the ODBC data source to
determine the most efficient index (if any) for processing a query and avoid the overhead
of sorting results.
• If you use a BY clause that will sort a large amount of data, make sure a corresponding
index exists in your data source to make sorting efficient. In some cases it may also be
desirable to have indexes over columns used in WHERE clause selection criteria.
• Avoid using the RECID function. Instead, use the ROWID function.
2–68
Programming Considerations
For some data sources, executing this SQL statement results in a full table scan. For a large
table, this can seriously degrade performance; however, the DataServer for ODBC provides a
way to perform the schema check without this SQL statement and the resulting full table scan.
It uses settings in the schema holder that modifies how the schema check is performed by using
an ODBC API called SQL_Column. The following Progress procedure appends the relevant
schema-holder switches in order to modify schema-check behavior:
FOR each_db:
DISPLAY _db-name _db-addr _db-type
_db-misc2[4] FORMAT "x(24)".
END.
Note that after performing this procedure, you must disconnect and reconnect to your schema
holder. Subsequent schema checks from the modified schema holder will not result in a full
table scan.
NOTE: Under normal circumstances, Progress Software Corporation recommends that you
do not modify your schema-holder database.
2–69
Progress DataServer for ODBC Guide
Unmatched definitions can cause corruption of the data source. For this reason, checking the
integrity of data definitions at run time ensures the data corruption due to unmatched definitions
will not occur. The skip schema check feature can be used to bypass this check at run time.
Because definition verification is time consuming in a production environment, you might
consider using the -Dsrv skip_schema_check startup parameter if your environment allows.
You might consider using this option to increase performance, but only if you are certain that
the data definitions in the data source match your schema holder definitions.
NOTE: The dataserv.lg log file denotes when the DataServer skips the schema check.
The following example shows how to use the -Dsrv parameter with the skip schema check
option in the CONNECT statement.
SYNTAX
-Dsrv skip_schema_check
CAUTION: If you use the skip schema check option, the DataServer skips the schema check
and does not detect discrepancies between the Progress schema definitions and the
data source data definitions. If there are discrepancies and the DataServer
continues to process queries, inserts, and deletions, your data source may become
corrupted. Progress Software Corporation recommends that you weigh carefully
the performance benefit against the risk to your database before deciding to use
-Dsrv skip_schema_check.
2–70
3
Configuring the DataServer
Configuring the DataServer for ODBC involves starting executables for several processes. This
chapter provides step-by-step instructions for initially setting up the DataServer. Specifically, it
describes how to:
Before you configure a DataServer, make sure that you have installed all of the required
software. For details, see the “Software Requirements” section in Chapter 3, “Configuring the
DataServer,”
Progress DataServer for ODBC Guide
• The Enterprise DataServer for ODBC can run in a variety of configurations. Some
configurations for this version of the DataServer involve a single process running on one
machine. Others involve multiple processes running on different machines across multiple
platforms.
For more details on the differences between the two versions, see Chapter 1, “Introduction.”
Before you configure a DataServer, you must register your data source as an ODBC data source.
For details, see the “Registering Your Data Source” section.
To set up a DataServer configuration, determine which components you need on which
platforms, then set up the appropriate executables on those platforms. Table 3–1 lists the
possible combinations and describes which executables you must set up on each machine. In
this table, the term local indicates that the DataServer component runs on the same machine as
the client, while the term remote indicates that the component runs on a different machine than
the client.
3–2
Configuring the DataServer
For instructions on setting up your DataServer configuration, see the sections that apply to the
platforms that you will use. For example, if you are configuring a local DataServer, see the
“Configuring a Local DataServer” section. If you are building a remote DataServer
configuration host, see the “Configuring the Remote DataServer” section.
3–3
Progress DataServer for ODBC Guide
3.2 Configuring the ODBC Driver and Registering the Data Source
Before you can configure the Progress DataServer:
• You might need to install your ODBC drivers and additional software required by the data
source vendor.
If you installed the Enterprise DataServer for ODBC, the ODBC drivers for the supported data
sources are bundled with the DataServer and are installed automatically.
If you installed the Personal DataServer for ODBC, you must purchase the drivers from the
vendor and install them separately.
NOTE: Configuring the client for an ODBC connection might require installing software
required by the non-Progress data source vendor. You must completely install any
additional client software required by the non-Progress data-source vendor before
you can register your data sources. For details, see the “Software Requirements”
section in Chapter 1, “Introduction.”
1 ♦ Start the ODBC administration tool for your data source. This can be either the
administration tool provided by Microsoft or a repackaging of that tool by a non-Progress
data-source vendor. Also, some vendors might provide a similar administration tool.
3–4
Configuring the DataServer
4 ♦ Specify a name for your data source. The name that you use to register a data source (often
abbreviated as DSN for data-source name) is also the name by which Progress recognizes
the data source.
5 ♦ Set other configuration options required or optionally allowed through the driver vendor’s
configuration utilities against the target database.
6 ♦ Text connect.
You can now configure the DataServer, as described in the following sections.
1 ♦ Install ODBC software and any client software required by the data source on the system
where your local DataServer resides.
NOTE: If you are configuring the Personal version of DataServer for ODBC with either
WebSpeed or AppServer, your local DataServer system is the system where the
WebSpeed or AppServer broker resides and executes. You must install
DataServer for ODBC and the data source client software at that location. If
environment information is required by the data source client, define the
environment using the Progress Explorer. See the Progress Explorer online Help
for instructions.
2 ♦ Make sure that you registered the data source with the ODBC driver correctly on the
appropriate machine.
Once you have set up your environment, you can build the schema holder for your ODBC data
source and connect using the client executable. See the “Creating a Schema Holder” section for
instructions.
3–5
Progress DataServer for ODBC Guide
• Broker—The DataServer broker (_probrkr.exe) or the broker for the Progress Explorer
on the host machine determines the types of requests coming over the network and starts
(spawns) the appropriate DataServer (_odbsrv.exe) for the client process.
NOTES:
• The Progress ODBC DataServer component is a client with respect to the ODBC
data-source configuration even though from the Progress point-of-view it resides on
the server machine. As a result, your ODBC software installation and any client
software required by the data source must reside on the machine from which the
DataServer and the broker processes will execute. In the remote DataServer
configuration, the Progress ODBC client component requires no special software or
configuration; it requires only a standalone Progress NT or UNIX client.
• Progress has no restrictions regarding the location of the actual database that your
ODBC data source name connects. See your data source documentation for possible
database configurations.
Before you can run the server components, you must configure the DataServer by setting the
required environment variables on the host machine. On NT, you configure using ProControl or
the Progress Explorer tool. See the “Configuring with ProControl” or the “Configuring with the
Progress Explorer” section for details.
NOTE: Configurations that use a remote DataServer on NT are available only with the
Enterprise DataServer for ODBC.
3–6
Configuring the DataServer
From the Windows Desktop choose Start→ Programs→ Progress→ Progress Explorer
Tool. The Progress Explorer appears in the MMC framework.
3 ♦ Connect to localhost.
4 ♦ From the Progress Explorer’s left pane, select the ODBC DataServer folder and
double-click. The list of existing DataServer brokers for ODBC appears in the right pane.
5 ♦ Select the DataServer instance whose properties you want to create or edit, and right-click.
A pop-up menu appears.
NOTE: The DataServer for ODBC installation provides one predefined DataServer
Broker (odbbroker1) and one predefined NameServer (NS1). Each broker is
referred to as an instance. See the Progress Explorer online help for more
information. You can use these predefined components as a starting point for
creating and configuring additional DataServer Brokers, and, if needed,
NameServers. (See the Progress Installation and Configuration Guide Version 9
for Windows or the Progress Installation and Configuration Guide Version 9 for
UNIX for information about the NameServer’s role in a configuration.)
6 ♦ Choose the Properties option from the pop-up menu. The Properties dialog box for that
instance appears.
NOTE: By default, your DataServer for ODBC broker instances are defined with a
controlling NameServer and are provided with a default Data Service. Progress
Software Corporation recommends using a NameServer configuration at all times. In
such cases, the DataServer client’s initial connection is to the NameServer. However,
you can alternatively connect the DataServer directly to the broker instance by
setting the -DataService value to none in the connection parameters of your schema
holder. If you will always use a -DataService value of none, you should remove the
controlling NameServer from your broker instance definition. See the “Starting and
Stopping a Broker Process from the Progress Explorer and Connecting a Client”
section in Chapter 4, “Connecting the DataServer” for more information about
connecting the DataServer to the NameServer and the broker.
3–7
Progress DataServer for ODBC Guide
Do not simultaneously run some DataServers for ODBC under brokers with
controlling NameServers and others directly under brokers (that is, without
controlling NameServers). This defeats the purpose of using a NameServer to control
brokers. If you do this, the benefits of the NameServer are lost and load balancing is
ineffective. Progress Software Corporation recommends that you always use a
NameServer, with one exception: you can choose initially to connect directly to a
broker to simplify confirming an initial connection. Once you establish a connection,
Progress recommends that you reintroduce the NameServer into your configuration.
1 ♦ Access ProControl by double-clicking its icon in the NT Control Panel. The ProControl
dialog box opens.
3 ♦ Choose the Options tab and activate the DataServer Page toggle box.
4 ♦ Choose OK and then choose Detail on the ProControl main window. The DataServers tab
appears.
5 ♦ Choose the DataServers tab and choose Insert to add an entry for the broker. The General
and Environment tabs appear.
6 ♦ Enter the appropriate information in the following fields in the General folder:
• Identifiers—Provide a unique name to identify the broker. The name must be unique
to the host. The identifier can be up to 30 characters long. For example, you might
name it odbbroker.
3–8
Configuring the DataServer
• Working Directory—Specify the directory that the broker uses, for example, to
create the dataserv.lg file.
• Service Name—Specify the value for the Service Name (-S) startup parameter.
Look in your install-path\system32\drivers\etc\services file for an available
service that the broker can use.
7 ♦ Activate the Auto Start toggle box if you want the broker to start automatically when you
boot the host machine. To start the broker automatically, you must also use the NT
Services utility to set the Progress ProService utility to start automatically.
9 ♦ In the Environment tab, set the ODBSRV variable to the DataServer executable that you
are using. The default is DLC/bin/_odbsrv.exe.
10 ♦ Choose OK.
Once you have completely set up your environment, you can build the schema holder for your
ODBC data source. See the “Creating a Schema Holder” section for instructions.
3–9
Progress DataServer for ODBC Guide
• When using the Progress broker (_probrkr.exe), you set the environment variables
described in this section from the command line using environment-variable commands at
the DOS shell prompt.
• When using the odbman Progress Explorer utility, set the environment variables described
in this section in the environment section of your broker properties file for the specific
broker instance definition.
• You must set and export environment variables in the same environment (DOS shell) from
which you plan to run the DataServer.
Table 3–2 describes the environment variables that you must set.
Variable Description
DSLOGDIR The pathname of the log file that Progress uses to keep
track of DataServer processes and error messages. By
default, Progress writes to @{DSLOGDIR}/dataserv.lg
where @{DSLOGDIR} is resolved to directory path of the log
(Optional) file "dataserv.lg".
Once you have completely set up your environment, you can build the schema holder for your
ODBC data source and connect using the client executable. See the “Creating a Schema Holder”
section for instructions.
3–10
Configuring the DataServer
• NameServers
• AppServers
• DataServers
• Databases
When you use this file to configure the DataServer for ODBC, you provide information that
enables the host to start a broker that spawns the appropriate DataServer process (_odbsrv.exe
or a custom executable that you built with PROBUILD).
Each configuration definition contains the environment variable and property settings for a
broker instance. The command-line utilities use this file to store, validate, and manage the
configurations for these brokers. A single copy of this file maintains all supported broker
configurations for each Progress installation.
3–11
Progress DataServer for ODBC Guide
Table 3–3 describes the sections in the ubroker.properties file that apply to the DataServer
for ODBC. The file configures a default NameServer named NameServer.NS1 and a default
broker named odbbroker1, which you can use either as is or as templates for your own
configuration specifications.
3–12
Configuring the DataServer
3–13
Progress DataServer for ODBC Guide
The following example illustrates the DataServer sections of the ubroker.properties file:
#
# Default properties for broker instances serving ODBC DataServers
#
[UBroker.OD]
srvrExecFile="@{Startup\DLC}\bin\_odbsrv.exe"
srvrStartupParam=-svub -S X -N TCP -U X -P X -hs 0 -s 40
operatingMode=State-aware
classMain=com.progress.ubroker.broker.ubroker
defaultService=0
initialSrvrInstance=0
minSrvrInstance=0
maxSrvrInstance=256
brkrLoggingLevel=3
description=ODBC DataServer Broker
#
# Sample ODBC DataServer Broker definition
#
[UBroker.OD.odbbroker1]
srvrExecFile="@{Startup\DLC}\bin\_odbsrv.exe"
srvrStartupParam=-svub -S X -N TCP -U X -P X -hs 0 -s 40
srvrLogFile=@{WorkPath}\odbbroker1.server.log
brokerLogFile=@{WorkPath}\odbbroker1.broker.log
portNumber=4444
defaultService=1
appserviceNameList=odbbroker1
controllingNameServer=NS1
environment=odbbroker1
uuid=172.18.103.53:1f415c:d6330e5d24:-7f1e
description=A sample ODBC DataServer Broker
#
# Environment for ODBC Dataserver Broker: odbbroker1
#
[Environment.odbbroker1]
DSLOGDIR=@{WorkPath}
For a complete description of the parameters included in each of these sections, see the
comments in the $DLC/properties/ubroker.properties file.
The ubroker.properties file is read on startup of the AdminServer process. For changes in any
used environment variables to take effect, the AdminServer must be restarted.
3–14
Configuring the DataServer
3–15
Progress DataServer for ODBC Guide
1. Establish the appropriate permissions for pulling the schema image into the schema
holder.
3. Create and then connect an empty Progress database. This database becomes your schema
holder and contains your schema image.
4. Create the schema holder, which involves specifying connection parameters and pulling
the schema from the data source.
3–16
Configuring the DataServer
The following sections list the data-source permissions required to create or update a schema
holder.
• DB2
You must have at least select permission on the following system objects: systables,
syscolumns, sysindexes, and syskeys.
• Informix
Where permissions are not explicit, you must have at least select permission on the catalog
files for tables, columns, indexes, keys, and/or procedures and user information.
• Microsoft Access
You must have Read Design permissions on the catalog files for tables, columns, indexes,
and keys and/or procedures, and on all user tables that you want to pull.
• Sybase
Microsoft SQL Server
You must have at least select permission on the following system objects: syscolumns,
sysindexes, sysobjects, and sysusers. For SQL Server 6.5, you must also have at least
select permission on the sysprocedures system object.
3–17
Progress DataServer for ODBC Guide
Application-specific Permissions
In addition to the ODBC data-source permissions required by the DataServer, the required
permissions for users depend on the applications that they are using. For example, a user who
is running a Progress application that queries but does not update the employee table in a data
source must connect to the data source with a login name and password combination that
provides at least select privileges for the employee table. For users who will manipulate data at
runtime, the appropriate read, insert, update, and delete permissions must be granted as
administered by the foreign (target) data source.
In summary, the login name (or user ID) and password combination required to run a particular
application depends on the following:
NOTE: The system administrator for your ODBC data source must establish all login name
and password combinations with the appropriate data-source commands and
procedures. See the documentation for your data source for information on granting
user permissions.
1 ♦ Verify that your non-Progress data source is accessible and that you can connect to it.
Non-Progress data-source vendors often provide interactive SQL tools that can serve as a
test for connectivity.
2 ♦ Verify that you have installed ODBC drivers and configured your data source
appropriately. Also, ensure that any client software required by the non-Progress data
source is installed and configured properly.
3 ♦ Once you have configured your data source (DSN), make sure that you can establish a
connection independent of using the Progress DataServer. ODBC driver vendors often
provide connectivity tools that test whether you can establish a connection to the data
source through an ODBC interface.
4 ♦ Start the DataServer as described in either the “Starting a Local DataServer” section or the
“Starting a Remote DataServer” section in Chapter 4, “Connecting the DataServer,”
whichever is appropriate for your configuration.
5 ♦ Open the Progress Data Administration tool or the character Data Dictionary.
3–18
Configuring the DataServer
1 ♦ Start Progress with no database connected and access the Data Administration tool.
2 ♦ Select the Create Database option. The Create Database dialog box appears:
3 ♦ Type the schema-holder name (for example, odbholder) in the New Physical Database
Name field.
5 ♦ Choose OK. The following dialog box appears. By default, the name of the newly created
data source appears in the Physical Name field:
3–19
Progress DataServer for ODBC Guide
You do not have to provide any additional connection information. You can add
connection parameters when you create the data source or edit connection information
later. See the online help for a complete description of the Connect Database dialog box.
6 ♦ Choose OK to connect the empty Progress database and return to the Tools main window.
1 ♦ From the Data Administration main menu, select DataServer→ ODBC Utilities→ Create
DataServer Schema. The following dialog box appears:
2 ♦ In the Logical Database Name field, type the name that you will use to connect to your
ODBC data source and refer to it in your programming applications. This name must be
different from the schema holder name. For more information on database names, see the
database access chapter in the Progress Programming Handbook.
NOTE: If you place the schema from a second ODBC data source into a schema holder,
the second schema must have a different logical database name from the first
schema. The schema holder has one physical name, but each schema that it
contains must have a different logical name.
3–20
Configuring the DataServer
3 ♦ In the Code Page field, type the name of the code page for the schema holder. The name
must be the Progress name for the code page that the data source uses. The default is
iso8859–1.
Table 3–4 lists the most common ODBC data-source code pages and the equivalent
Progress names.
iso_1 iso8859–1
(default schema-holder code page)
cp850 ibm850
If you use a code page that Progress does not support, you must supply a conversion table
that translates between the Progress client code page and the code page that your data
source uses. For a complete discussion of code pages, see the Progress
Internationalization Guide.
See Chapter 4, “Connecting the DataServer,” for a description of the required and optional
connection parameters.
5 ♦ In the ODBC Data Source Name field, type the name that you used when you registered
the data source with the ODBC administration tool.
3–21
Progress DataServer for ODBC Guide
6 ♦ Choose OK. The utility prompts you for your data-source user ID and password. If they
are required by the non-Progress data source and you did not provide them in the
Connection Parameters field (see Step 4), enter a data-source user ID and password
combination that has select privileges for the system objects listed in the “Establishing
Permissions” section and read access to other database objects that the schema holder will
include.
7 ♦ Choose OK. When the DataServer connects to the ODBC data source, it reads information
about data-source objects. The following dialog box appears:
You can select tables based on the object name, owner name, and qualifier. For example,
you can specify A* in the Object Name field to list all the tables whose names begin with
A.
Note that for DB2 data sources only, you must type the name of the DB2 database in the
Object Owner field. If the DB2 database name is different from the authorization ID for
the tables being selected, type the authorization ID in the Object Owner field.
NOTE: Progress Software Corporation recommends that you do not specify an entry that
consists exclusively of wild cards for each of the three entry fields in the dialog
box. An entry that consists exclusively of wild cards might degrade the
performance of the database when you perform a schema pull. (It will include
system catalog files from the data source not typically included in user
databases.)
3–22
Configuring the DataServer
8 ♦ Choose OK. Progress displays a list of the data-source objects that you can include in the
schema holder:
If you specified all wild cards as your table-selection criteria, the list might also include
system-owned objects, which you do not have to include in the schema holder.
9 ♦ Select the objects that you want to include in the schema holder and choose OK. The
DataServer reads information about the data-source objects that you select and loads their
data definitions into the schema holder. The time that this process takes depends on the
size and number of data-source objects that you select.
For each data-source table, the DataServer attempts to select an index to support the
Progress ROWID. If an appropriate index does not exist, the DataServer issues the
warning, “Please check warnings and messages in the file ds_upd.e.” The ds_upd.e file
lists the objects that do not support ROWID. You can change the DataServer’s selection
of an index to support ROWID by using the Progress Data Dictionary. See the “Defining
the ROWID” section in Chapter 5, “The DataServer Tutorial,” for instructions. For
additional information, see the “Indexes” and “ROWID Function” sections, respectively,
in Chapter 2, “Programming Considerations.”
3–23
Progress DataServer for ODBC Guide
If you make changes to an ODBC data source, make sure to update the associated schema holder
to reflect those changes if you want them to be accessible to a DataServer application. Note that
you do not need to update the schema holder if the application will never access data objects
affected by the change. For example, if you add a table object that a DataServer application will
never access, you do not need to update the schema holder.
Each time that you update the schema holder, you must recompile your DataServer application
(.p and .w files) to generate new r-code.
• Allow your users to use the DataServer Update/Add Table Definitions utility.
• Send a new data definition file for the schema holder. Your users can use the DataServer
Delete Schema utility to empty the original schema holder. They can then load the new
data-definition file into the schema holder.
3 ♦ Recompile code against the updated schema holder to build new r-code.
5 ♦ Distribute copies of the new schema holder .db and .bi files to your users. You must use
the Progress PROCOPY utility to distribute them.
3–24
4
Connecting the DataServer
You can start and connect a DataServer using one of the following methods:
• Starting a local or remote DataServer using one of the above listed methods
• Connection guidelines
1 ♦ Make sure that your ODBC drivers, as well as any client software required by the
non-Progress data source vendor, are installed and configured properly.
3 ♦ Set any environment variables required for your configuration as described in the relevant
section of Chapter 3, “Configuring the DataServer” (for example, DSLOGDIR). You must
set them in the environment from which you are starting the DataServer.
NOTE: If you change the values of any environment variables such as ODBC_HOME,
you must shut down the DataServer processes and restart them.
For example, the following command starts Progress with the local DataServer, connects
a local schema holder named odbholder in single-user mode, and connects the ODBC data
source demo with the user bob whose password is bobpass:
prowin32 odbholder -1 -db demo -dt ODBC -ld demo -U bob -P bobpass
4–2
Connecting the DataServer
1 ♦ Start the DataServer broker process on your host machine. For details, see one of the
following sections:
• “Starting and Stopping a Broker Process from the Progress Explorer and Connecting
a Client”
On the NT Host
Before you attempt to start the DataServer in the Explorer, be sure that you have configured it
completely. After starting the broker from the Progress Explorer, you start your Progress client
as you would in any remote DataServer configuration.
To start and stop the DataServer from the Explorer, see the Progress Explorer online Help.
On the Client
After you start the broker on the host machine from the Progress Explorer, you can connect your
UNIX or Windows client. Use the same parameters that you would use to connect to the schema
holder and ODBC data source in a standard probrkr configuration. In addition:
• Include the -Dsrv SVUB,1 parameter. This parameter allows you to connect to the broker
administered by the Explorer.
4–3
Progress DataServer for ODBC Guide
properties file. If a default DataService has been defined for your broker instance, you can
omit this parameter and connect using the default service.
-DataService none
– The port number assigned to the controlling NameServer (when the -DataService
value is not “none”) or the port number of the broker instance that you started in the
Explorer (when the -DataService value is “none”)
– The service name in your /etc/services file whose associated port matches the port
of the controlling NameServer (when the -DataService value is not “none”) or the
broker instance that you started in the Explorer (when the -DataService value is
“none”)
• Set the -H parameter to the name of the machine where the NameServer and/or broker
instance are running.
If you do not set the required -Dsrv SVUB,1 and optional -DataService data–service connection
parameters as described in this section, the client is assumed to be configured for a standard
Progress broker and the -H and -S parameters are used to locate a probrkr executable on the
appropriate host machine. By setting the SVUB parameter on, you redirect the -H and -S
parameters to locate the appropriate NameServer and/or broker on the host machine. The
following example illustrates how to use these connection parameters for a client that connects
to a NameServer:
4–4
Connecting the DataServer
1 ♦ Once you ensure the Progress AdminService is running, to start the DataServer broker,
enter this command at the system prompt on the machine where the broker will run:
In this command, broker–name is the name that you specified for the broker when you
configured it. Optionally, you can indicate a user account by specifying
-user user–name.
If you want to run the broker from a remote machine, you must specify additional options
that identify the remote host, as follows:
In this command:
• broker–name is the name that you specified for your DataServer broker instance
when you configured your ubroker.properties file.
• host–name is the name of the host machine on which you want the broker to run.
• user–name is the user ID of the system account under which the broker will run.
2 ♦ To stop the DataServer broker, enter this command at the system prompt on the machine
where the broker will run:
You can stop a broker on a remote machine by adding the -host and user–name options.
See the “ODBMAN Utility” entry in Appendix C, “Progress Explorer Command Line Utilities
and Startup Parameters,” for a description of all the command options.
4–5
Progress DataServer for ODBC Guide
1 ♦ To start the broker, select it from the selection list and choose Start. The broker spawns the
DataServer process when a client requests a connection.
Alternatively, you can start and stop an NT broker process from the command line. For details,
see the “Starting and Stopping a Broker Process from the Command Line” section.
1 ♦ Set the environment variable ODBSRV to the name of the executable (including the path)
of the DataServer for ODBC. Be sure to set this variable on the host machine.
2 ♦ To start the DataServer broker process, enter the following command at the system prompt
on your NT host machine. Select a value for service–name from the list of available
services in your \windows-install-dir\system32\drivers\etc\services file:
For example, the following command uses the default broker executable. The service
name demosv is a service listed in that file:
After you start the NT broker process, you are ready to start a Progress client on a PC running
Windows or NT or on a UNIX machine. See the “Starting the NT or Windows Client Process”
section or the “Starting the UNIX Client Process” section for instructions.
4–6
Connecting the DataServer
1. The executable.
2. The schema holder name. If you have multiple schema holders, create a program icon for
each schema holder.
For example, a command line for a Progress Windows client process that you use to access an
ODBC data source might look like this:
prowin32 odbholder -RO -db demo -dt ODBC -ld demo -H host1 -S oserviceA
-N TCP -U bob -P bobpass
See the “Connecting a Schema Holder at Startup” section for command-line information and
more examples.
pro
You can supply the connection parameters required by the DataServer when you start the client
process, or you can include them in the Connection Parameters field when you create a schema
holder. For example, this command starts the Progress client, connects a read-only schema
holder named odbholder, and connects the ODBC data source demo with the user bob whose
password is bobpass:
pro odbholder -RO -db demo -dt ODBC -ld odbdemo -H host1 -S oserviceA
-N TCP -U bob -P bobpass
See the “Connecting a Schema Holder at Startup” section for descriptions of the required
command line.
4–7
Progress DataServer for ODBC Guide
• Standard—Requires that a client pass a user ID and password that the ODBC data source
validates against the list of users in the syslogins table. The request typically comes from
a nontrusted connection, such as through TCP/IP. The Progress client or WebSpeed agent
passes this information with the User ID (-U) and Password (-P) connection parameters.
– If the connection is trusted and the client provides no user ID, a user ID that consists
entirely of spaces, or a user ID that matches the user that started the process, the
ODBC data source accepts the connection.
– If the connection is nontrusted, the Progress client must provide the user ID and
password.
Progress Software Corporation recommends the following guidelines for working with an
ODBC data source and NT security:
• Configure an ODBC data source to use Standard or Mixed security if you are using remote
Progress clients.
• If you are using Mixed security, always have the clients specify the -U and -P connection
parameters.
4–8
Connecting the DataServer
• Use the Progress Data Dictionary or Data Administration tool. From the main menu, select
Database→ Connect and supply the schema holder’s physical name and the appropriate
connection parameters. You cannot use the Auto–Connect option to connect to an ODBC
data source. You connect to the data source when you select it as your working database.
• Use the Progress 4GL CONNECT statement (see its reference entry in the Progress
Language Reference). A CONNECT statement must first list the schema holder and
related connection parameters, then the ODBC data source and related parameters.
For example, this command connects a schema holder named holder and an
ODBC-supported data source named odbdemo:
You can use combinations of different connection techniques. For example, you can connect the
schema holder at startup, then connect to the DataServer using the Progress CONNECT
statement. Any combination of connection techniques works, as long as you follow these steps
in the order shown:
1 ♦ Connect the schema holder first. If you are not updating the schema holder, you can
specify the Read-only (-RO) connection parameter to enhance DataServer performance.
If you connect to the schema holder and the ODBC data source in a single startup command or
connection statement, be sure to specify parameters that affect the schema holder before the
Database Name (-db) parameter. Specify only those parameters that affect the ODBC data
source connection after the -db parameter.
The following section explains how to connect both a schema holder and an ODBC data source
when you start up Progress.
4–9
Progress DataServer for ODBC Guide
Database Type ODBC Optional Specifies that the type of the target data source is ODBC.
Note that the data source must be a supported ODBC data
(-dt ODBC)
source.
Physical Database Name Required Indicates the name by which Progress recognizes the
ODBC data source to which you want to connect. This
(-db) name must match the name that you used when you
registered the data source as an ODBC data source.
Logical Database Name Optional Specifies the logical name of the ODBC data source. This
is the name that you use to refer to the data source in your
(-ld)
applications. You must use this parameter only when the
logical data-source name differs from its physical name.
This name should match the logical database name that you
defined in your schema holder.
For example, your applications might refer to the Sybase
demo database as mydemo. In this case, the physical name
is demo, and the logical name is mydemo.
Host Name Required for Indicates the name of the host machine in the network.
remote
(-H) DataServer
Service Name Required for Indicates the name of the service that you are calling. If you
remote use the NameServer with Progress Explorer, specify the
(-S)
DataServer service name or IP address of the host machine where the
NameServer resides. If you are using probrkr, ProControl,
or the Progress Explorer without a NameServer, specify the
service name or IP address of the host machine where the
broker resides.
4–10
Connecting the DataServer
Network Type Optional Indicates the network type. TCP is the only possible value.
(-N )
User ID Required if the Supplies the login name that the DataServer uses to log into
ODBC data the ODBC data source.
(-U)
source requires it
Password Required if the Supplies the password that the DataServer uses to log into
ODBC data the ODBC data source. Different login name and password
(-P) source requires it combinations allow for different levels of user privileges.
Data Service Required for Specifies the data service the NameServer uses. This must
Progress be used in conjuction with the -Dsrv option SVUB,1. For
(-DataService)
Explorer more information, see the "Starting and Stopping a Broker
connections Process from the Progress Explorer and Connecting a
Client" section.
Single–User Mode Optional Specifies that a schema holder is used in single-user mode.
Single–User Mode is the default unless a server is started
(-1)
for the schema holder.
Local Cache Optional Specifies that you are using a local cache file for the
schema holder. Create the cache file with the SAVE
(-cache)
CACHE COMPLETE statement.
4–11
Progress DataServer for ODBC Guide
DataServer Optional Specifies options with which you control your ODBC
Driver and DataServer environment. See the “Query
(-Dsrv) Tuning with Connection and Startup Parameters” section
in this chapter and the "ODBC Options" section in Chapter
6 for more information.
NOTE: When you specify a list of -Dsrv parameters, be
sure not to include any spaces anywhere in this
list.
Server Join Optional Specifies that the client evaluates and performs queries that
have joins. This might slow performance, but it provides
(-nojoinbysqldb)
results that are consistent with Progress behavior.
Use -nojoinbysqldb at startup time.
• For a local DataServer, the parameter file must contain the -db parameter and can
optionally contain the -Dsrv, -U, and -P connection parameters, depending on the
requirements of the data service.
• For a remote DataServer, the same parameter conditions apply as for a local DataServer.
In addition, a remote connection must contain the -H and -S connection parameters.
You can add more startup and connection parameters than the ones listed—these are the typical
parameters. For a complete list of parameters and for information on how to create a parameter
file, see the Progress Startup Command and Parameter Reference.
4–12
Connecting the DataServer
• In single-user mode
• In a local-DataServer configuration
You can type these commands on the command line of a program item property box.
The following examples start Progress in a local DataServer configuration. In these examples:
• The physical data-source name (and the ODBC data-source name) is sports.
prowin32 odbholder -RO -db sports -dt ODBC -ld mysport -U bob -P bobpass
-Dsrv qt_debug,EXTENDED,PRGRS_CONNECT,server=sqlserv1
4–13
Progress DataServer for ODBC Guide
• In single-user mode
• In a remote-DataServer configuration
On a Windows Client:
On a UNIX Client:
The following examples start Progress in a remote DataServer configuration. In these examples:
4–14
Connecting the DataServer
On a Windows Client:
prowin32 odbholder -RO -db sports -dt ODBC -ld mydemo -H host1
-S odbsrv -N TCP -U bob -P bobpass
-Dsrv qt_debug,EXTENDED,PRGRS_CONNECT,server=sqlserv1
On a UNIX Client:
pro odbholder -RO -db sports -dt ODBC -ld mydemo -H host1
-S odbsrv -N TCP -U bob -P bobpass
-Dsrv qt_debug,EXTENDED,PRGRS_CONNECT,server=sqlserv1
NOTE:
This configuration assumes you started the remote DataSever broker using the
command line interface or ProControl.
To connect to a DataSever broker started through the Progress Explorer you must add
the SVUB,1 setting to the -Dsrv parameter and add the -DataService name
parameter.
4–15
Progress DataServer for ODBC Guide
SYNTAX
-Dsrv PRGRS_CONNECT,connection-string;
• To establish complex connections that require more than the Physical Database Name
(-db), User ID (-U), and Password (-P) parameters, as follows:
For datasrc–name, supply the name of the ODBC data source. Server is a driver-specific
keyword. The -Dsrv connection string is passed directly to the data source. The DataServer
does not modify this value.
• To connect to an ODBC data source whose name has a blank space, which is not allowed
by Progress, substitute the characters &^ for the illegal characters in the data-source name.
Progress ignores datasrc–name when you use PRGRS_CONNECT; however, you must
supply it to pass syntax validation. Supply the name as part of the connection string for
PRGRS_CONNECT, as follows:
4–16
Connecting the DataServer
• To connect to the ODBC data source using the ODBC driver as a guide, specify an empty
PRGRS_CONNECT, which tells the ODBC driver to handle the entire connection process
interactively. This technique is useful if you are not sure about what connection
parameters to use for a particular ODBC data source. For example:
SYNTAX
SYNTAX
4–17
Progress DataServer for ODBC Guide
Table 4–2 describes the query-tuning options that you can specify with the -Dsrv parameter.
Table 4–2: Connection Query-tuning Options (1 of 2)
Option Description
4–18
Connecting the DataServer
Option Description
qt_separate_connection Specifies whether each cursor should use a separate connection to the ODBC
data source. The default is qt_no_separate_connection, which provides
qt_no_separate_connection behavior that is consistent with Progress.
Specify qt_separate_connection to use a separate connection. Executing
cursors in separate connections can improve performance because the
DataServer does not have to restart the cursors.
qt_cache_size,integer Specifies the size in bytes of the cache used by lookahead cursors. A larger
cache size can improve performance for queries that return a large number
of records because the DataServer might need fewer SQL statements to get
the results.
Minimum: The DataServer always caches at least one record.
Maximum: None
Default: 30000
The following example shows how to use the query-tuning options to enhance performance.
The DataServer opens a separate connection to ODBC for each cursor and writes an extended
report on the SQL statements it executes:
CONNECT holder -db infdb -dt ODBC -ld demo -U user -P password -Dsrv
qt_separate_connection,qt_debug,EXTENDED.
Progress provides a startup parameter called Server Join (-nojoinbysqldb) that controls the
default JOIN–BY–SQLDB behavior. You specify this parameter in the startup command for
your Progress session. It overrides the JOIN–BY–SQLDB default so that the client evaluates
and performs joins. Using this parameter might slow performance, but it provides results that
are consistent with Progress behavior. It also allows you to run DataServer applications on
Version 8 clients with Version 7 DataServers. See Chapter 2, “Programming Considerations,”
for more information.
4–19
Progress DataServer for ODBC Guide
Option Description
4–20
Connecting the DataServer
Option Description
NOTE: Turning on debugging options decreases DataServer performance. Be sure to turn off
debugging options when you run DataServer applications in production mode.
This connection statement causes the DataServer to report on the time that ODBC operations
take:
4–21
Progress DataServer for ODBC Guide
For example, the following statement creates a cache file named sqlcache for the sqlhold
schema holder:
To use the cache file for a schema holder, specify the Schema Cache File (-cache) startup
parameter and the cache filename when you connect to the schema holder. For example, the
following CONNECT statement connects an ODBC-supported database whose data source
name is sqlserv1 with the schema sqlhold and tells Progress to use the cache file:
CONNECT sqlhold -RO -cache sqlchache -db sqlbdb -dt ODBC -ld sqldemo
-U bob -P bobpass -Dsrv qt_debug,EXTENDED,PRGRS_CONNECT,server=sqlserv1.
If you make any changes to a schema holder, you must create a new cache file for it. For more
information, see the Progress Programming Handbook and the SAVE CACHE Statement
reference entry in the Progress Language Reference.
4–22
Connecting the DataServer
During an attempted auto-connect The system aborts the remainder of the connect as
though the remainder never existed, and a run-time
error condition occurs. Any connections that you
made prior to the failed connection remain in
effect. You cannot trap auto-connect run-time
error conditions.
During an attempt to connect using The Data Dictionary displays an error message and
the Progress Data Dictionary returns to the main window.
During an attempt to connect a The system responds with a warning but you can
connected ODBC data source with the continue. You can use the NO–ERROR option to
same logical name suppress the warning.
• The Progress or ODBC-required environment variables are not set correctly when using
the Enterprise DataServer and a broker. For environment-variable information, see
Chapter 3, “Configuring the DataServer.”
• You have an outdated version of an ODBC DLL; for example, ODBC16.DLL, which runs on
16-bit machines only. This prevents Progress from accessing the data source, though you
might still be able to access the data source through your ODBC driver using another
product, such as MS Query.
4–23
Progress DataServer for ODBC Guide
• The data source has not been started or is not running correctly. Use the data-source
utilities to check the status of the data source and the ability to connect to it.
• You omitted a -Dsrv parameter that is required for the data source to which you are
attempting to connect. See the “Connecting a Schema Holder at Startup” section and
"ODBC Option" section in Chapter 6 for details.
• The login name and password combination that you provided during connection is invalid
for the data source.
• You specified an incorrect ODBC data-source name when you created the schema holder.
In the first case, additional connections are necessary only if your application executes
additional database requests while a cursor on a stored procedure is still open.
You can use the -Dsrv qt_separate_connection parameter or the corresponding
QUERY–TUNING option (SEPARATE–CONNECTION) to specify that the DataServer uses
a separate connection for each statement that requires a cursor. However, if you want to use the
main connection when performing joins on the server, use the -Dsrv qt_no_separate_connection
parameter when you connect. Note that using a separate connection allows only read-only
access to the database. You must issue transactions that require update access to your database
from your main connection.
4–24
Connecting the DataServer
For example, the following statement specifies that the DataServer use a separate connection
for the FOR EACH each customer query:
• Database type
• User ID
• SQL statements
Specifying the -Dsrv qt_debug option causes the DataServer to write to the dataserv.lg file
information about the SQL ODBC calls that it generates as well.
To obtain access to the Enterprise DataServer log file, follow these steps on the host machine:
1 ♦ Before starting up the broker process, set the DSLOGDIR environment variable to the
name of the directory where you want to place the log file.
If you set the environment variable, Progress writes the information to the dataserv.lg
file. If Progress cannot open this file or $DSLOGDIR is unset, it writes the information to
the dataserv.lg file in the process’ current directory, and appends to it with each
subsequent process that uses it.
2 ♦ Open the dataserv.lg file to read the DataServer log. For information on debug options
that affect DataServer log output, see the “Analyzing Performance” section.
4–25
Progress DataServer for ODBC Guide
4–26
5
The DataServer Tutorial
This chapter presents step-by-step instructions for tasks associated with the DataServer. Some
of these exercises relate to maintaining the schema holder. After providing an overview of the
ODBC demonstration databases, the tutorial describes how to perform the following tasks:
• Sufficient ODBC data-source privileges to create a database, add users, and create tables
5–2
The DataServer Tutorial
7 ♦ Specify mysport as data source name. The name that you use to register a data source is
the name that Progress recognizes.
9 ♦ Make sure that the target ODBC data source has started.
NT or Windows
install-path\dlc\bin\prowin32
Starting a local Progress session also automatically starts the local DataServer.
11 ♦ On Windows or NT, access the Progress Data Administration tool. Create a copy of the
Sports database and connect to it.
Original Progress Database Accept the name of the connected source database
or type the name of a database to which to connect.
Connect parameters for If you did not specify a new value for the Name of
PROGRESS the Original PROGRESS Database parameter, do
not modify the Connect parameters for
PROGRESS Database parameter.
If you did specify a new value, type any additional
connect parameters that are necessary.
Name of Schema holder Type the name of the schema holder. The utility
Database creates the schema holder if it does not exist.
5–3
Progress DataServer for ODBC Guide
ODBC data source Name Type the data source name (This is the name you
specified when registering the data source in step 7
of the above section “Preparing to Use the
DataServer Utilities.”). This is the name of the
schema image and the name that you will use to
refer to the target database in applications. The
data-source name must be different from the name
that you typed for the schema holder and different
from the name of any other schema image existing
in that schema holder.
Foreign DBMS type Select the foreign data-source type to which the
ODBC driver is connecting. Progress provides the
following choices: SQL Server 6, Sybase,
DB2/MVS, DB2/6000, DB2/NT, Informix, MS
Access, and OTHER. Select OTHER if you are
accessing a target data source other than the ones
listed here. Note that you will get only the generic
ODBC SQL-92 functionality if you access
databases other than the ones listed here.
Progress 4GL Compatible Check this toggle box to create an ODBC data
Objects source that supports arrays, case-insensitive
indexes, backward and forward scrolling, and the
Progress record identifier. These objects result in
the addition of columns to your foreign data-source
tables.
Uncheck this toggle box if you do not want the
Extended 4GL capability.
5–4
The DataServer Tutorial
Move data Check this toggle box to dump and load data from
the Progress database to the target database.
Copying data from a large database can take a long
time. You can uncheck this toggle box if you want
to dump and load data at a more convenient time.
This toggle box is available only if the Load SQL
toggle box is checked.
Running the utility creates and connects a schema holder and the ODBC data source. It
operates as follows:
b) SQL that creates the schema is sent to the foreign data manager.
d) The foreign schema holder and the Progress database are compared and all
information needed by Progress is applied to the schema holder.
e) Data is loaded.
g) A message is displayed that tells the user which startup procedure to use to connect.
5–5
Progress DataServer for ODBC Guide
14 ♦ Choose DataServer→ ODBC Utilities to see the available DataServer utilities, described
in Table 5–2.
Create DataServer Creates a schema image in the schema holder for an ODBC
Schema... data source.
Update/Add Table Updates the schema holder to reflect any changes that you
Definitions... make to data-source data definitions.
Verify Table Makes sure that the data definitions in the schema holder
Definition... match your data-source data definitions.
Change DataServer Changes the code page in the schema holder associated with
Schema Code Page... the ODBC data source.
15 ♦ When you access a DataServer utility (as you will do in the tutorials that follow this
section), the following dialog box might appear before the utility opens:
5–6
The DataServer Tutorial
In the User ID and Password dialog box, choose OK if you are satisfied with the user ID
and password combination that you have already supplied. If you want to change them, or
they were never specified, enter a user ID and password with the privileges required for
creating and updating a schema holder. See the “Establishing Permissions” section in
Chapter 3, “Configuring the DataServer,” for information.
• Add object definitions from the ODBC data source to a schema holder. Use this option if
you add a new table or view to the data-source data definitions and want the schema holder
to reflect the change.
• Update existing object definitions in a schema holder to reflect a change in the supporting
data-source object definitions.
1 ♦ Access the Progress Data Administration tool, if you are not already there, and select
DataServer→ ODBC Utilities→ Update/Add Table Definitions. The following dialog box
appears:
5–7
Progress DataServer for ODBC Guide
2 ♦ Type preselection criteria values into the fields as required. These values preselect the
data-source objects that the utility uses to update the schema holder. By default, the
wildcard symbol (*) appears; it specifies that the utility uses all of the objects in the data
source.
Note that for DB2 data sources, you must type the name of the DB2 database in the Object
Owner field. If the DB2 database name is different from the authorization ID for the tables
being selected, type the authorization ID in the Object Owner field.
NOTE: For each of the three entry fields in the dialog box, if you enter a value that
consists only of wild cards, you might degrade the performance of the database
when you perform a schema pull. (It will include system catalog files that are not
typically included in user databases.)
3 ♦ Choose OK. A dialog box lists the objects and table information that you have preselected,
for example:
4 ♦ Select the objects that you want to update, then choose OK. When the update completes,
Progress returns to the Data Administration main window.
When the update completes, Progress reminds you to check the ds_upd.e file. This file contains
information about the tables that did not support record IDs as well as other warnings.
5–8
The DataServer Tutorial
When you update a definition, Progress overwrites the old definition with the new one based on
the current data-source object. It also preserves the Progress-specific table information. As a
result, if you want to add a new column to a table in your ODBC data source and then update
the definition, you do not have to re-enter all of the Progress-specific information for the
previously existing columns (fields) in the definition.
NOTE: When you update a table in the schema holder with the Update/Add Table
Definitions utility, the information for the user-defined ROWID is lost. You must
reselect an index to support the ROWID.
• Severe—These differences might cause your application to malfunction. When the Verify
utility detects severe differences, it automatically updates the schema holder to solve the
discrepancies by adjusting the schema-image information in the schema holder to match
the data-source definitions. Severe differences in definitions that the DataServer uses
internally also cause the schema holder to be updated.
5–9
Progress DataServer for ODBC Guide
5–10
The DataServer Tutorial
1 ♦ Access the Progress Data Administration tool, if you are not already there, and select
DataServer→ ODBC Utilities→ Verify Table Definition. The following dialog box
appears:
2 ♦ Type preselection criteria values into the fields if desired. These values preselect the
data-source objects that the utility uses to update the schema holder. By default, the wild
card symbol (*) appears; it specifies that the utility uses all of the objects in the data source.
3 ♦ By default, the utility verifies objects in the schema holder that match objects in the ODBC
data source. To check whether there are objects in the data source that are not represented
in the schema holder, deselect the toggle box labeled “Verify only objects that currently
exist in the schema holder.”
5–11
Progress DataServer for ODBC Guide
4 ♦ Choose OK. A dialog box lists the objects and table information that you preselected, for
example:
5 ♦ Select the objects that you want to verify, then choose OK.
6 ♦ To select tables by matching a pattern, choose the Select Some button. The following
dialog box appears:
7 ♦ Type the pattern that you want to match, then choose OK to start the verification. A dialog
box that lists the objects and the verification results appears.
5–12
The DataServer Tutorial
8 ♦ Choose the View Reports button to view a description of the differences found, for
example:
10 ♦ The utility automatically selects objects with severe differences for updating. You can
select or deselect all other objects as you wish. Note that you must resolve retained
differences manually. Retained differences appear in subsequent reports until you resolve
them.
11 ♦ Choose OK to start the update or Cancel to quit the utility without updating the schema
holder.
5–13
Progress DataServer for ODBC Guide
1 ♦ Access the Progress Data Administration tool, if you are not already there, and select
DataServer→ ODBC Utilities→ Edit Connection Information. The following dialog box
appears:
2 ♦ Make changes to the Connection Parameters fields as required. When you are done,
choose OK to return to the Data Administration main window.
The changes do not take effect until you disconnect and reconnect the schema holder. When you
reconnect, Progress uses the new connection parameters.
For details on connection parameters, see Chapter 4, “Connecting the DataServer,” and the
Progress Startup Command and Parameter Reference.
Using the Edit utility to change the logical name of an ODBC data source causes the tool to
close; this is because you started the tool when you were connected to the data source under
another name. To continue working with the utilities, simply restart the tool.
NOTE: If you change the ODBC Data Source Name (DSN), do not select a DSN that uses a
different ODBC driver than the original DSN. Configuration switches residing in the
schema holder are dependent on driver name. You will receive only a warning if you
do use a different driver, but the schema holder configuration may no longer match
the characteristics of the driver and cause unpredictable run-time results.
5–14
The DataServer Tutorial
2 ♦ Select a table from the Tables list; for example, the customer table.
3 ♦ Choose the Table Properties button. The following dialog box appears:
5–15
Progress DataServer for ODBC Guide
4 ♦ Choose the Validation button. The Table Validation dialog box appears. You can change
either the validation expression or the message by typing new text in the fields.
1 ♦ Access the Data Dictionary, if you are not already there, and choose the Fields button. The
Tables list appears.
4 ♦ Choose the Field Properties button. The following dialog box appears:
You can enter Progress information at the field level, such as a validation expression or a
validation message.
5–16
The DataServer Tutorial
The Data Dictionary displays the standard ODBC SQL names for data types and not the
native ODBC data-source names. Using the Data Dictionary, you can make the following
changes:
• Change the data type or the format in which Progress displays the data. For example,
the Microsoft SQL Server smallint data type maps to the ODBC SQL
SQL_SMALLINT data type, which in turn maps to the Progress INTEGER data
type. However, you can change the SQL_SMALLINT mapping to the Progress
DECIMAL or LOGICAL data type instead. (See the “Data Types” section in Chapter
2, “Programming Considerations,” for information on optional settings for data
types.)
• For CHARACTER fields that are not indexed, you can change the case sensitivity.
NOTE: You cannot create fields or add mandatory or extent properties to them.
5 ♦ Choose the DataServer button to view the field name and position as stored in the ODBC
data source. A dialog box similar to the following appears:
NOTE: You cannot change ODBC data-source information using the Data Dictionary.
For example, the Cust–num field is named Cust_num in the demonstration
database.
6 ♦ Choose OK.
7 ♦ When you are done making changes, choose OK to return to the Data Dictionary main
window.
5–17
Progress DataServer for ODBC Guide
• If the data-source table has a PROGRESS_RECID column, the DataServer selects that
column. A column of this type provides optimal support for the ROWID function; you
cannot select an alternative to it.
• If the data-source table does not have a PROGRESS_RECID column, the DataServer
evaluates the available indexes and selects one according to the following preferences:
If more than one index in the data-source table meets the second level—unique,
single-component, integer—the DataServer selects the first such index that it encounters to
support the ROWID function. Note that the indexes in this class are not mandatory, hence it is
essential that you enforce the column supporting ROWID as mandatory at least through code if
not through definitions. If your application handles an index in such a way as to make it a better
support for the ROWID function, you can designate it in the Progress Data Dictionary.
NOTE: An index that you select as a ROWID must be defined as a unique index. It must also
be mandatory, if not by definition, then by means of the application code.
To select an index to support the ROWID function, follow these steps in the Data Dictionary
with the schema holder connected (you do not have to connect to the ODBC data source):
5–18
The DataServer Tutorial
5 ♦ Double-click an index to see detailed information on its attributes. The following dialog
box appears:
5–19
Progress DataServer for ODBC Guide
1 ♦ Access the Progress Data Administration tool, if you are not already there, and select
DataServer→ ODBC Utilities→ Change DataServer Schema Code Page. The utility
displays a message about the possibility of corrupting your database by using the wrong
code page.
3 ♦ Either accept the current value or type the Progress and ODBC data-source names
separated by a slash (/) for a code page that the data source supports.
Table 5–4 lists the most common ODBC data-source code pages and the equivalent
Progress names.
iso_1 iso8859–1
(default schema-image code page)
cp850 ibm850
5–20
The DataServer Tutorial
If you are using a code page that the table does not list, see the Progress
Internationalization Guide for a complete list of code pages that Progress supports. If you
are using an unsupported code page, Progress allows you to create your own conversion
tables.
4 ♦ Choose OK to change the code page and return to the Data Administration main window.
If you were connected to the schema holder and the ODBC data source when you chose to
change the code page, Progress disconnects you to make the change. The Connect
Database dialog box appears to allow you to reconnect.
1 ♦ Access the Progress Data Administration tool and select DataServer→ ODBC Utilities→
Delete DataServer Schema. A dialog box appears, prompting you to verify the deletion.
2 ♦ Choose Yes to verify your selection. After Progress deletes the schema holder, it displays
a confirmation message.
5–21
Progress DataServer for ODBC Guide
1 ♦ Name the columns of a data-source table that you want the DataServer to roll into an array
column##1, column##2, etc. The columns must be adjacent and in sequence.
2 ♦ Make sure that these columns are of the same data type. For example, if you want the
schema holder to include an array named MONTH with 12 elements, the ODBC
data-source table must have 12 adjacent columns of the same data type named month##1,
month##2, month##3, and so forth. Progress names the corresponding field in the schema
holder month. In your applications, refer to each element of the array as month[1],
month[2], month[3], and so forth.
3 ♦ If you have already created your schema holder, update it to reflect your changes to the
data-source table.
NOTE: For Informix arrays , enter the text "_ _" (two underscores) instead of "##" (two
number signs).
1 ♦ Add a column of the same data type before the indexed column. The new column must
immediately precede the indexed column.
For example, if your table has an indexed column named emp_id, name the new column
_S#_emp_id. The new column accommodates the uppercase version of the index.
3 ♦ Set the _S#_ column to the uppercase value of the original column.
4 ♦ Re-create the index with the _S#_ column as a component in place of the original column.
5 ♦ If you have already created your schema holder, update it to reflect your changes to the
data-source table.
NOTE: For Informix Case-insensitive indexes, provide "_S__ (underscore followed by "S"
followed by two "_") instead of "_S#_" (underscore followed by "S" followed by
number sign followed by underscore).
5–22
The DataServer Tutorial
1 ♦ Add a column of the integer data type named PROGRESS_RECID. The new column must
be able to contain null:
4 ♦ Change the nonunique indexes so that they include a PROGRESS_RECID column as the
last component:
5 ♦ If you have already created your schema holder, update it to reflect your changes to the
data-source table.
5–23
Progress DataServer for ODBC Guide
• Optionally populates the ODBC data source by dumping and loading the data from the
Progress database
The ODBC data source that you create with this utility is a basis for an application database.
Before deploying your new ODBC data source, you might want to make manual adjustments to
take advantage of additional ODBC-compliant features that are not supported by the migration
utility.
The Progress-to-ODBC utility requires a local Progress database.
5–24
The DataServer Tutorial
1 ♦ Create a target data source. You must use an empty target data source when you run the
Progress-to-ODBC utility.
2 ♦ Configure your ODBC driver to connect to your new target data source.
3 ♦ Start the Progress client and connect to the Progress database that you want to migrate to
the target data source.
NOTE: For a DBE (double-byte enabled) DataServer application, you must specify the
Internal Code Page (-cpinternal) and Stream Code Page (-cpstream) parameters
when you start the Progress client. The values that you specify for these
parameters must match the code page that the target data source uses.
4 ♦ From the Data Administration tool, choose DataServer→ ODBC Utilities→ Schema
Migration Tools→ PROGRESS DB to ODBC.
5–25
Progress DataServer for ODBC Guide
Original Progress Database Accept the name of the connected source database or
type the name of a database to which to connect.
Connect parameters for If you did not specify a new value for the Name of the
PROGRESS Original PROGRESS Database parameter, do not
modify the Connect parameters for PROGRESS
Database parameter.
If you did specify a new value, type any additional
connect parameters that are necessary.
Name of Schema holder Type the name of the schema holder. The utility creates
Database the schema holder if it does not exist.
5–26
The DataServer Tutorial
ODBC Data Source Name Type the data-source name (This is the name you
specified when registering the data source in step 2 of
the above section “Running the Progress-to-ODBC
Utility.”). This is the name of the schema image and the
name that you will use to refer to the target database in
applications. The data-source name must be different
from the name that you typed for the schema holder and
different from the name of any other schema image
existing in that schema holder.
Foreign DBMS type Select the foreign data-source type to which the ODBC
driver is connecting. Progress provides the following
choices: SQL Server 6, Sybase, DB2/MVS, DB2/6000,
DB2/NT, Informix, MS Access, and OTHER. Select
OTHER if you are accessing a target data source other
than the ones listed here. Note that you will get only the
generic ODBC SQL-92 functionality if you access
databases other than the ones listed here.
ODBC connect parameters Type additional connection parameters for the schema
holder. The utility provides the required -U and -P
parameters, but you might want to specify others.
Codepage for Schema Image Type the Progress name for the code page that the
ODBC data source uses. By default, the code page for a
schema holder is ibm850. You can leave this field blank
and use the Change Code Page utility to add the code
page information for the schema holder later.
Progress 4GL Compatible Check this toggle box to create an ODBC data source
Objects that supports arrays, case-insensitive indexes, backward
and forward scrolling, and the Progress record
identifier. These objects result in the addition of
columns to your foreign data-source tables.
Uncheck this toggle box if you do not want the Extended
4GL capability.
5–27
Progress DataServer for ODBC Guide
Load SQL If enabled, check this toggle box to execute the .sql file
that contains the data definition for your Progress
database and load these definitions into the target data
source.
Uncheck this toggle box to generate only the SQL script.
Move data Check this toggle box to dump and load data from the
Progress database to the target database. Copying data
from a large database can take a long time. You can
uncheck this toggle box if you want to dump and load
data at a more convenient time.
This toggle box is available only if the Load SQL toggle
box is checked.
If you want a complete migration of your Progress database to a target data source, you must
enter information in all fields and check all toggle boxes.
The utility creates a schema holder, updates the empty target data source that you created to
contain the objects stored in your Progress database, and creates a startup procedure that you
can use to connect your schema holder. The startup procedure derives its name from the ODBC
name for your target database. For example, if you specified “sports” as the ODBC data-source
name, the utility creates the csports.p startup procedure.
1 ♦ Create a target ODBC data source. You must use an empty target data source when you
run the Progress-to-ODBC utility.
2 ♦ Configure your ODBC driver to connect to your new target data source.
5–28
The DataServer Tutorial
3 ♦ On your client machine, pass parameters to the utility by setting the environment variables
listed in Table 5–6.
Environment
Variable Description
ODBCDBNAME Specifies the logical name of the target data source. The logical
name of the data source can be the same as its physical name,
but it must be different from the name that you enter for the
schema holder.
ODBCUSERNAME Specifies the user name for the target data source.
ODBCPASSWORD Specifies the password of the user for the target data source.
ODCBCODEPAGE Specifies the Progress name for the code page that the ODBC
data source uses. By default, the code page for a schema holder
is ibm850. You can leave this field blank and use the Change
Code page utility to add the code page information for the
schema holder later.
ODBCTYPE Selects the foreign data-source type to which the ODBC driver
is connecting. Progress provides the following choices: SQL
Server 6, Sybase, DB2/MVS, DB2/6000, DB2/NT, Informix,
MS Access, and OTHER. Select OTHER if you are accessing
a target data source other than those listed here. Note that you
will get only the generic ODBC SQL-92 functionality if you
access databases other than those listed here.
LOADSQL Allows you to specify whether you want the utility to create the
schema in your empty ODBC data source. Specify YES to
enable this behavior.
5–29
Progress DataServer for ODBC Guide
Environment
Variable Description
4 ♦ Enter the following commands to set and export environment variables at the system
prompt, then run protoodb.p:
NOTE: You might need to append the Progress libraries to your PROPATH environment
variable in order for the executable to find .p or .r files.
5–30
6
Troubleshooting
This chapter describes common problems and how to work around them. Specifically, it
explains troubleshooting techniques for:
• Tuning your environment with the -Dsrv startup parameter, including information on the
following:
– Connection problems
– Key-buffer size
– Large rows
– Schema import
For information on troubleshooting DataServer connections, see the “Connection Failures and
Progress Responses” and “Accessing the DataServer Log” sections in Chapter 4, “Connecting
the DataServer.”
Progress DataServer for ODBC Guide
SYNTAX
SYNTAX
In this syntax:
• The data–source–name argument is the name of the data source and the logical–name
argument is its logical name, which is defined when you created your schema image.
Here is an example of how to use the CONNECT statement with the -Dsrv parameter:
Note that MAX_R is an abbreviation of MAX_ROWS. You can abbreviate option names as
long as they identify parameters uniquely.
Both the syntax statements and the example show the use of the -Dsrv startup parameter in
CONNECT statements. You can also specify -Dsrv options in a parameter file, on a program
item command line, or in the Connection Parameters field in the Database Connect dialog box.
6–2
Troubleshooting
ACCESS_MODE SQL_ACCESS_MODE
ASYNC_ENABLE SQL_ASYNC_ENABLE
AUTOCOMMIT SQL_AUTOCOMMIT
LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
MAX_LENGTH SQL_MAX_LENGTH
MAX_ROWS SQL_MAX_ROWS
NOSCAN SQL_NOSCAN
OPT_TRACE SQL_OPT_TRACE
PACKET_SIZE SQL_PACKET_SIZE
QUERY_TIMEOUT SQL_QUERY_TIMEOUT
RESP_POLLCT SQL_RESP_POLLCT
RESP_TIMEOUT SQL_RESP_TIMEOUT
TXN_ISOLATION SQL_TXN_ISOLATION
Refer to any good ODBC application developer’s guide for information on the ODBC-defined
options.
When you specify a Progress-supplied ODBC option with the -Dsrv startup parameter, the
DataServer sends the option to the ODBC driver for processing by the ODBC interface.
6–3
Progress DataServer for ODBC Guide
The following example of the -Dsrv startup parameter tells the ODBC driver to return no more
than 1,000 rows to the Progress application:
-Dsrv MAX_ROWS,1000
NOTE: The DataServer generally sets the correct value automatically. Therefore, you should
reserve use of the ODBC options for troubleshooting and fine-tuning purposes only.
See the ODBC Programmer’s Reference for more information on these options.
Option Description
6–4
Troubleshooting
Option Description
6–5
Progress DataServer for ODBC Guide
Option Description
The following example of the -Dsrv startup parameter sets the number of keys in the scrolling
buffer to 100:
-Dsrv PRGRS_IDBUF,100
Various sections in the “Using ODBC and DataServer Options” section discuss when and how
to use these options.
6–6
Troubleshooting
6–7
Progress DataServer for ODBC Guide
SYNTAX
-Dsrv PRGRS_CONNECT,connection-string;
The connection string is separated from the option by a comma (,) and ends with a semicolon (;).
Use the PRGRS_CONNECT option in the following cases:
• To connect to an ODBC data source whose name is not allowed by Progress; for example,
a name that includes blank spaces, ampersands (&), commas (,), and/or carets (^). In the
connection string, pass the following characters rather than the unallowed characters. The
driver resolves the passed characters to the unallowed character:
• To establish complex connections that require more than the Physical Database Name
(-db), User ID (-U), and Password (-P) parameters. In all cases, the values must not be
space delimited and must be passed in a single connection string. For example, the
following connection string sets the user ID and password for the server and user ID and
password for the data source:
DSN=sports;UID=server;PWD=serverpass;UIDDBMS=bob;PWDDBMS=bobpass
For more information and syntax examples, see the “Special Connection Issues” section in
Chapter 4, “Connecting the DataServer.”
6–8
Troubleshooting
6–9
Progress DataServer for ODBC Guide
• Some drivers might fail in reusing a prepared statement or in getting the second record for
a particular query. Using -Dsrv PRGRS_PREPCACHE,0 instructs the DataServer to
re-prepare each SQL statement.
• Use the PRGRS_PREPCACHE option to control the size of the cache. The default cache
size is 20 statements. You can increase the size for large applications that reuse many
queries. The maximum size depends on the amount of resources you have available.
6–10
Troubleshooting
6–11
Progress DataServer for ODBC Guide
6–12
A
Upgrading DataServer Applications
This appendix describes how to upgrade a DataServer application. You can perform either of
the following types of upgrades:
1 ♦ Start the version of Progress with which the schema holder was created, then connect to
the schema holder.
2 ♦ Dump the data definitions (.df file) from the schema holder and move the .df file to the
new client machine, if necessary. Dumping and loading a .df file is the only way to
preserve any information that you might have added to the schema, such as display
formats, help strings, and validation expressions.
5 ♦ From the Data Admin main menu, choose Admin→ Load Data and Definitions→ Data
Definitions (.df).
The utility loads the .df file into the schema holder.
7 ♦ Use the Verify Table Definitions DataServer utility to verify the data definitions in the
schema holder.
A–2
Upgrading DataServer Applications
1 ♦ Upgrade the earlier version of your data source to a newer version. See the documentation
for your data source for instructions.
2 ♦ Using the Progress Data Admin Dump utility, dump a data definition (.df) file from the
schema holder you used to access the ODBC data source.
4 ♦ Using the Progress Data Admin Load utility, load the .df file into the empty Progress
database. This results in a new schema holder for your data source.
A–3
Progress DataServer for ODBC Guide
A–4
B
Stored Procedure Reference
This appendix contains reference entries for the following Progress 4GL extensions, which
support sending SQL statements from within Progress procedures:
• PROC–HANDLE function
• PROC–STATUS function
SYNTAX
procedure
The name of the stored procedure that you want to close or the built-in procedure name,
send–sql–statement.
integer–field = PROC–STATUS
Assigns the return value from a stored procedure to the specified integer field or variable
(integer–field).
An integer field or variable whose value uniquely identifies the stored procedure that
produces the results returned from the data source or the SQL cursor of a
send–sql–statement stored procedure.
B–2
CLOSE STORED–PROCEDURE Statement
NOTES
• If you specified a PROC–HANDLE when you ran a stored procedure, you must specify
the PROC–HANDLE when you close the stored procedure.
• You cannot close a send–sql–statement procedure until you have retrieved all row results.
• You can close all stored procedures at once with the following statement:
SEE ALSO
PROC–HANDLE Function, PROC–STATUS Function, RUN STORED–PROCEDURE
Statement
B–3
PROC–HANDLE Function
PROC–HANDLE Function
SYNTAX
PROC-HANDLE
EXAMPLE
This procedure runs the stored procedure pcust and writes the procedure handle to the variable
hdl. It writes the results of the stored procedure identified by this procedure handle into the
Progress-supplied buffer, proc–text–buffer, and displays it:
NOTES
• Progress Software Corporation recommends that you specify a procedure handle for each
stored procedure that you run.
• You do not have to specify a handle if there is only one active stored procedure and you
do not include SQL statements in the Progress application.
SEE ALSO
CLOSE STORED–PROCEDURE Statement, PROC–STATUS Function, RUN
STORED–PROCEDURE Statement
B–4
PROC–STATUS Function
PROC–STATUS Function
SYNTAX
PROC-STATUS
EXAMPLE
This procedure runs the stored procedure pcust and writes the results of the stored procedure
into the Progress-supplied buffer, proc–text–buffer. The CLOSE STORED–PROCEDURE
statement then retrieves the output parameters. The return status is written to the variable stat
and is displayed:
NOTE: For descriptions of the possible values for the return status of a non-Progress stored
procedure, see your non-Progress documentation.
SEE ALSO
CLOSE STORED–PROCEDURE Statement, PROC–HANDLE Function, RUN
STORED–PROCEDURE Statement
B–5
RUN STORED–PROCEDURE Statement
SYNTAX
procedure
The name of the stored procedure that you want to run or the Progress built-in procedure
name, send–sql–statement, to send SQL to an SQL-based data source.
integer–field = PROC–HANDLE
Assigns a value to the specified integer field or variable (integer–field) that uniquely
identifies the stored procedure returning results from the non-Progress database or that
uniquely identifies the SQL cursor used to retrieve results from an ODBC-compliant data
source.
NO–ERROR
Specifies that any ERROR conditions that the RUN STORED–PROCEDURE statement
produces are suppressed. Before you close a stored procedure, check the
ERROR–STATUS handle for information on any errors that occurred. You receive an
error when you attempt to close a stored procedure that did not start.
NOTE: This option must appear before any run-time parameter list.
B–6
RUN STORED–PROCEDURE Statement
parameter
A run-time parameter to be passed to the stored procedure. A parameter has the following
syntax:
SYNTAX
If you run send–sql–statement for an SQL-based data source, you must pass a single
character expression parameter containing the SQL statement you want the data source to
execute.
If you do not specify parameter–name (the name of a keyword parameter defined by the
stored procedure), you must supply all of the parameters in correct order. If you do specify
parameter–name, you must precede your assignment statement with the keyword
PARAM. If you do not supply a required parameter, and no default is specified in the
stored procedure, you receive a run-time error.
EXAMPLES
This procedure runs the stored procedure pcust and writes the results of the stored procedure
into the Progress-supplied buffer, proc–text–buffer:
B–7
RUN STORED–PROCEDURE Statement
This code example shows how to trap errors from the non-Progress RDBMS within a procedure:
NOTE: The RUN STORED–PROCEDURE statement starts a transaction with the same
scope as transactions started with the UPDATE statement.
SEE ALSO
CLOSE STORED–PROCEDURE Statement, PROC–HANDLE Function, PROC–STATUS
Function
B–8
C
Progress Explorer Command Line Utilities
and Startup Parameters
This appendix describes the following utilities and parameters that you use to configure,
manage, start, and stop the DataServer host and client.
• Progress Explorer command line utilities allow you to start, stop, and configure installed
ODBC components. See the Progress Installation and Configuration Guide Version 9 for
Windows for additional information about the utilities and their role and relationship to
other system administration facilities.
• Startup commands and parameters for UNIX and Windows allow you to start and manage
DataServer clients. See the Progress Startup Command and Parameter Reference for
additional information about syntax and usage.
Progress DataServer for ODBC Guide
NSCONFIG Utility
Use the NSCONFIG utility to help you debug existing NameServer configurations defined in a
properties file, such as the ubroker.properties file. This utility displays the property settings
associated with a NameServer configuration, and checks that the syntax and values are valid.
The NSCONFIG utility runs locally, on the machine on which the AdminServer is running. The
utility does not run across the network:
SYNTAX
Operating
System Syntax
Windows nsconfig
[
[
[ -name name-server ]
[ -propfile path-to-properties-file ]
[ -validate ]
]
| -help
]
PARAMETERS
-name name–server
Specifies which existing NameServer configuration to examine. The name must match the
name of an existing NameServer configuration in the specified properties file. If you do
not specify a NameServer, the NSCONFIG utility analyzes all NameServer configurations
defined in the properties file specified by the -propfile parameter.
C–2
Progress Explorer Command Line Utilities and Startup Parameters
-propfile path–to–properties–file
-validate
Checks the syntax and values of property settings defined in the specified properties file.
-help
NOTES
• A single NameServer can simultaneously support all of the AppServer, WebSpeed and
DataServer products using Progress Explorer.
• The ubroker.properties file stores all the configuration definitions for each instance of
the NameServer, AppServer, DataServer and WebSpeed Transaction Server products.
Each configuration definition contains environment variables, registry entries if Windows
NT, and property settings for each product instance. Progress Explorer and certain
command-line utilities, such as NSCONFIG, use this file to store, validate and manage the
configurations for the products.
The file consists of a hierarchical structure of configuration entities, where parent entities
provide configuration information that you can override or extend in each child entity.
Each configuration entity has a name that begins the entity definition, and the definition
contains configuration settings for one or more product instances.
C–3
Progress DataServer for ODBC Guide
Parent entities provide default values for all of their child entities. For example, the parent
[UBroker] contains a set of definitions that can be inherited by its child [NameServer],
and then again by its child [NameServer.product–instance–name]. However, at any
child level, a redefinition of any value supersedes the default value of its parent. All
children from the redefinition level down inherit this new value.
Optionally, you may edit the ubroker.properties file using a text editor such as vi or
Notepad. If you want to manually edit this file to create or modify a product configuration,
begin by making a backup copy from the installed ubroker.properties file (and naming
it for example, test.properties). Once you edit the properties file, use the relevant
validation utility such as ODBCONFIG to validate the changes and make sure there are no
syntax errors or conflicts.
C–4
Progress Explorer Command Line Utilities and Startup Parameters
NSMAN Utility
Use the NSMAN utility to control the operation of a configured NameServer. The utility allows
you to start a NameServer, query its status, and shut down a NameServer:
SYNTAX
Operating
System Syntax
Windows nsman
{
{ -name name-server
{
-kill
| -start
| -stop
| -query
}
[
-host host-name -user user-name
| -user user-name
]
[ -port port-number ]
}
| -help
}
PARAMETERS
-name name–server
-kill
Stops and removes the NameServer from memory, no matter what it is doing.
-start
C–5
Progress DataServer for ODBC Guide
-stop
-query
-host host–name
Specifies the name of the machine where the AdminServer is running. If a host name is
not specified, it defaults to the local host name.
-user user–name
Specifies a user name and prompts for a password. A user name and password are required
only when you use the -host parameter and specify a remote host name. If you specify a
remote host name with the -host parameter, but do not specify a user name with the -user
parameter, you receive a prompt for a user–name and password.
-port port–number
Specifies the port number of the machine on which the AdminServer is running. If a port
number is not specified, it defaults to 20931.
-help
NOTES
• A single NameServer can simultaneously support all of the AppServer, WebSpeed and
DataServer products.
• When you specify a user name with the -user parameter, Windows NT supports three
different formats:
– A user name as a simple text string, such as “mary,” implies a local user whose user
account is defined on the local NT server machine, which is the same machine that
runs the AdminServer.
– A user name as an explicit local user name, in which the user account is defined on
the same machine that runs the AdminServer except the user name explicitly
references the local machine domain, for example “.\mary”.
C–6
Progress Explorer Command Line Utilities and Startup Parameters
C–7
Progress DataServer for ODBC Guide
ODBCONFIG Utility
Use the ODBCONFIG utility to help you debug existing DataServer for ODBC configurations
defined in a properties file, such as the ubroker.properties file. This utility displays the
property settings associated with a DataServer for ODBC configuration, and checks that the
syntax and values are valid.
The ODBCONFIG utility runs locally, on the machine on which the AdminServer is running.
The utility does not run across the network:
SYNTAX
Operating
System Syntax
Windows odbconfig
[
[
[ -name DataServer-name ]
[ -propfile path-to-properties-file ]
[ -validate ]
]
| -help
]
PARAMETERS
-name DataServer–name
Specifies which existing DataServer for ODBC configuration to examine. The name must
match the name of an existing DataServer for ODBC configuration defined in the specified
properties file. If you do not specify a DataServer by name, the ODBCONFIG utility
analyzes all DataServer for ODBC configurations defined in the properties file specified
by the -propfile parameter.
C–8
Progress Explorer Command Line Utilities and Startup Parameters
-propfile path–to–properties–file
-validate
Checks the syntax and values of property settings defined in the specified properties file.
-help
NOTES
• The ubroker.properties file stores all the configuration definitions for each instance of
the NameServer, AppServer, DataServer and WebSpeed Transaction Server products.
Each configuration definition contains environment variables, registry entries if Windows
NT, and property settings for each product instance. Progress Explorer and certain
command-line utilities, such as ODBCONFIG, use this file to store, validate and manage
the configurations for the products.
• The file consists of a hierarchical structure of configuration entities, where parent entities
provide configuration information that you can override or extend in each child entity.
Each configuration entity has a name that begins the entity definition, and the definition
contains configuration settings for one or more product instances.
C–9
Progress DataServer for ODBC Guide
• Parent entities provide default values for all of their child entities. For example, the parent
[UBroker] contains a set of definitions that can be inherited by its child [UBroker.OD],
and then again by its child [UBroker.OD.product–instance–name]. However, at any
child level, a redefinition of any value supersedes the default value of its parent. All
children from the redefinition level down inherit this new value.
• Optionally, you may edit the ubroker.properties file using a text editor such as vi or
Notepad. If you want to manually edit this file to create or modify a product configuration,
begin by making a backup copy from the installed ubroker.properties file (and naming
it for example, test.properties). Once you edit the properties file, use the relevant
validation utility such as ODBCONFIG to validate the changes and make sure there are no
syntax errors or conflicts.
C–10
Progress Explorer Command Line Utilities and Startup Parameters
ODBMAN Utility
Use the ODBMAN utility to control the operation of a configured DataServer for ODBC. The
utility allows you to start a broker, query its status, start and stop additional DataServer servers,
and shut down the broker:
SYNTAX
Operating
System Syntax
Windows odbman
{
{ -name DataServer-name
{
-kill
| -start
| -stop
| -query
}
[
-host host-name -user user-name
| -user user-name
]
[ -port port-number ]
}
| -help
}
PARAMETERS
-name DataServer–name
-kill
Stops and removes the DataServer from memory, no matter what it is doing.
-start
C–11
Progress DataServer for ODBC Guide
-stop
-query
-host host–name
Specifies the name of the machine where the AdminServer is running. If a host name is
not specified, it defaults to the local host name.
-user user–name
Specifies a user name and prompts for a password. A user name and password are required
only when you use the -host parameter and specify a remote host name. If you specify a
remote host name with the -host parameter, but do not specify a user name with the -user
parameter, you receive a prompt for a username and password.
-port port–number
Specifies the port number of the machine on which the AdminServer is running. If a port
number is not specified, it defaults to 20931.
-help
NOTES
• When you specify a user name with the -user parameter, Windows NT supports three
different formats:
– A user name as a simple text string, such as “mary,” implies a local user whose user
account is defined on the local NT server machine, which is the same machine that
runs the AdminServer.
– A user name as an explicit local user name, in which the user account is defined on
the same machine that runs the AdminServer except the user name explicitly
references the local machine domain, for example “.\mary”.
C–12
Progress Explorer Command Line Utilities and Startup Parameters
SYNTAX
Operating Syntax
System
network-type ]
PARAMETERS
dbname
Specifies the name of the database where you are connecting to.
service–name
host–name
Specifies the name of the machine where the DataServer broker is installed. The default
value is the current host.
network–type
Specifies the network protocol for which the broker will run.
NOTES
• See the Progress Startup Command and Parameter Reference for more details on the
Server Name (-S), Host Name (-H), and Network Type (-N) startup parameters.
• You can use any of the startup parameters with the PROBRKR command. See the
Progress Startup Command and Parameter Reference for details.
• You must start the remote broker in the same environment in which your ODBC data
source names (DSNs) are defined because the servers spawned by the broker inherit the
C–13
Progress DataServer for ODBC Guide
setup of the environment from the broker. For example, set the environment variable
ODBSRV to the name of the executable (including the path) of the DataServer for ODBC.
Be sure to set this variable on the host machine. Also, in the same environment, make sure
you have set all ODBC environment variables required to connect to the data source. See
Chapter 3, “Configuring the DataServer,” for examples of required variables.
• Start the broker on a node that is locally connected to the disk containing the data source.
• To shutdown the broker, use the PPROSHUT command with the Gateway parameter
(-Gw).
C–14
Progress Explorer Command Line Utilities and Startup Parameters
Parameter Syntax
C–15
Progress DataServer for ODBC Guide
C–16
Index
A Buffers
allocating dynamically 6–9
Abbreviated index 2–44 defining for stored procedures 2–54
Aggregates BY option
in views 2–14 FOR EACH statement 2–11
joins 2–66
Analyzing performance 4–20
Arrays 2–23 C
in joins 2–66
manually creating support 5–22 Cache files
supporting in data source 5–21 changes to schema holders 4–22
creating 4–11
Audience xi local schema cache 4–21
Auto-commit 6–7 Caching
schema 1–7
Auto-connect
failure response 4–23 Case-insensitive indexes 2–12
manually creating support 5–22
supporting in data source 5–21
B
Character sets 2–7
BEGINS function 2–44 changing in a schema holder 5–20
empty character strings 2–43 most common 5–20
Bold typeface CLOSE STORED-PROCEDURE statement
as typographical convention xiii 2–50, B–2
retrieving parameter values 2–53
Brokers
DataServer C–14 Code pages 2–7
starting from MS-DOS 3–9, 4–6 changing in a schema holder 5–20
Progress DataServer for ODBC Guide
Index–2
Index
Index–3
Progress DataServer for ODBC Guide
Index–4
Index
Index–5
Progress DataServer for ODBC Guide
NSCONFIG C–2
P
NSMAN C–5 PARAM option
retrieving parameter values 2–53
NULL search condition 2–45 stored procedures B–7
Index–6
Index
Index–7
Progress DataServer for ODBC Guide
Index–8
Index
Index–9
Progress DataServer for ODBC Guide
Index–10
Index
V W
VALIDATE statement 2–26 Word index
CONTAINS operator 2–44
Validation
expressions 5–16, 5–17
messages 5–16 Z
Verifying schema holders 5–9 Zero-length character strings 2–24, 2–43
Views 2–13
aggregates 2–14
browsing 2–14
Index–11
Progress DataServer for ODBC Guide
Index–12