Progress Manual SQL
Progress Manual SQL
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
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Organization of This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How to Use This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Syntax Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Useful Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4GL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DataServers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SQL-92 Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ODBC Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Overview of ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 The Progress SQL-92 ODBC Driver . . . . . . . . . . . . . . . . . . . . 1.1.2 ODBC Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring Progress Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Configuring Data Sources with the ODBC Administrator Utility . . . . . . . 2.1.1 Adding a New Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Modifying a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.3 Test Connect Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.4 Test Connect Success . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Connecting to a Data Source Using a Logon Dialog Box . . . . . . . . . . . . 2.3 Connecting to a Data Source Using a Connection String . . . . . . . . . . . .
vii vii vii vii viii viii ix xii xii xiii xiii xiv xiv xiv xv 11 12 12 13 21 22 22 27 28 29 29 210
2.
Contents 2.4 2.5 2.6 3. Isolation and Lock Levels Supported . . . . . . . . . . . . . . . . . . . . . . . . . . . ODBC Conformance Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connections and Statements Supported . . . . . . . . . . . . . . . . . . . . . . . . . 211 211 211 31 32 34 34 37 39 312 41 42 42 43 43 43 44 45 46 46 A1 B1
ODBC API and Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Numeric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The UNIX Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Configuring the ODBC Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Setting Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.2 Configuring A Progress Data Source . . . . . . . . . . . . . . . . . . . . 4.1.3 The System Information File (.odbc.ini) . . . . . . . . . . . . . . . . . . 4.1.4 Sample Solaris System Information File . . . . . . . . . . . . . . . . . . 4.1.5 The ODBCINI Environment Variable. . . . . . . . . . . . . . . . . . . . . 4.2 Running an ODBC Client Application on UNIX . . . . . . . . . . . . . . . . . . . . 4.3 Using Double-Byte Character Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Translators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SQLGetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Progress and ODBC Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.
A. B.
iv
Contents Tables Table 21: Table 31: Table 32: Table 33: Table 34: Table 41: Table 42: Table 43: Table 44: Table 45: Table A1: Table B1: Connection String Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scalar String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scalar Numeric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scalar Time and Date Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scalar System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ODBC Driver File Location by Platform . . . . . . . . . . . . . . . . . . . . . . . . . ODBC Driver Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . System Information File Entries by Platform . . . . . . . . . . . . . . . . . . . . . Runtime System Shared Library Path Settings . . . . . . . . . . . . . . . . . . . Translators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Progress and ODBC Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 35 37 310 312 42 42 44 45 46 A2 B2
vi
Preface
Purpose
This manual describes how to configure the Progress SQL-92 ODBC driver to provide access to the Progress database from desktop tools and applications that support the ODBC (Open Database Connectivity) interface. This manual also provides details about the information returned to your application by the driver. The Progress SQL-92 ODBC driver is supplied by MERANT Inc. In this manual, the driver will be referred to generically as the Progress SQL-92 ODBC driver.
Audience
This book is designed as a guide for anyone who wants to use the Progress SQL-92 ODBC driver to access a Progress Version 9 database.
Progress ODBC Driver Guide Chapter 4, The UNIX Environment This chapter describes how to configure the Progress SQL-92 ODBC Driver in the UNIX environment. Appendix A, SQLGetInfo This appendix shows information the Progress SQL-92 ODBC driver Returns to SQLGetInfo. Appendix B, Progress and ODBC Data Types This appendix shows how the Progress data types are mapped to the standard ODBC data types. Glossary Defines terms introduced in this guide. Index
Typographical Conventions
This manual uses the following typographical conventions:
Bold typeface indicates: Commands or characters that the user types That a word carries particular weight or emphasis
Italic typeface indicates: Progress variable information that the user supplies New terms Titles of complete publications
viii
Preface
Monospaced typeface
indicates:
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
Syntax Notation
The syntax for each SQL-92 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 an expression or a statement. In this example, GRANT, RESOURCE, DBA, and TO are keywords: SYNTAX
GRANT
RESOURCE, DBA
TO user_name [, user_name
] ...
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 GRANT statement you must supply at least one user_name. Square brackets ([ ] ) around an item indicate that the item, or a choice of one of the enclosed items, is optional. ix
Progress ODBC Driver Guide In this syntax example the first user_name is required, and additional user_name specifications are optional: SYNTAX
GRANT
RESOURCE, DBA
TO user_name [, user_name
] ...
Braces ({ }) around an item indicate that the item, or a choice of one of the enclosed items, is required. In the GRANT example, you must specify either RESOURCE or DBA or both, and at least one user_name. Any user_name specifications after the first are optional: SYNTAX
GRANT
RESOURCE, DBA
TO user_name [, user_name
] ...
In some cases, braces are not a syntax notation, but part of the language. For example, this excerpt from an ODBC application invokes a stored procedure using the ODBC syntax { call procedure_name ( param ) }, where braces and parentheses are part of the language: SYNTAX
proc1( param, "{ call proc2 (param) }", param);
A vertical bar (|) indicates a choice. In the CREATE SYNONYM example you must specify a table_name, view_name, or synonym but you can only choose one. Note that in all SQL-92 syntax, if you specify the optional owner_name qualifier, there must not be a blank between the period separator and the table_name or view_name or synonym: SYNTAX
CREATE
PUBLIC
FOR [ owner_name.
]{
|synonym } ;
Preface In the DELETE FROM example, you must specify one of table_name or view_name: SYNTAX
DELETE FROM
owner_name.]{table_name |view_name }
WHERE search_condition ] ;
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 the ORDER BY example, you must include one expression (expr) or column position (posn), and you can optionally specify the sort order as ascending (ASC) or descending (DESC). You can specify additional expressions or column positions for sorting within a sorted result set. The SQL-92 engine orders the rows on the basis of the first expr or posn. If the values are the same, the second expr or posn is used in the ordering: SYNTAX
ORDER BY
{ [ {
expr expr
| posn } [ | posn } [
ASC ASC
| |
DESC DESC
] ] ] ... ]
In the GRANT example, you must include one user_name, but you can optionally include more. Note that each subsequent user_name must be preceded by a comma: SYNTAX
GRANT
RESOURCE, DBA
TO user_name [, user_name
] ...
In many 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.
xi
Progress ODBC Driver Guide In this example, CREATE VIEW is followed by several optional items: SYNTAX
CREATE VIEW
owner_name.
]view_name
... ) ] [ ) ] [ WITH
CHECK OPTION
[(
AS
column_name [, column_name ]
query_expression
xii
Preface 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. Progress Startup Command and Parameter Reference A reference manual that describes the Progress startup commands and parameters in alphabetical order. Welcome to Progress (Hard copy only) 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. 4GL Progress Internationalization Guide A guide to developing Progress applications for markets worldwide. The guide covers both internationalizationwriting an application so that it adapts readily to different locales (languages, cultures, or regions)and localizationadapting an application to different locales. 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. Progress Database Administration Guide and Reference This guide describes Progress database administration concepts and procedures. The procedures allow you to create and maintain your Progress databases and manage their performance.
xiii
Progress ODBC Driver Guide 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, such as: the Progress DataServer for Microsoft SQL Server Guide, the Progress DataServer for ODBC Guide, the Progress DataServer for ORACLE Guide, or the Progress/400 Product Guide SQL-92 Progress Embedded SQL-92 Guide and Reference A guide to Progress Embedded SQL-92 for C, including step-by-step instructions for building ESQL-92 applications and reference information about all Embedded SQL-92 Preprocessor statements and supporting function calls. This guide also describes the relationship between ESQL-92 and the ANSI standards upon which it is based. Progress JDBC Driver Guide 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 drivers support for the JDBC interface. Progress SQL-92 Guide and Reference 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. SQL-92 Reference (These are non-Progress resources available from your technical bookseller.) A Guide to the SQL Standard Date, C.J., with Hugh Darwen. 1997. Reading, MA: Addison Wesley. Understanding the New SQL: A Complete Guide Melton, Jim (Digital Equipment Corporation) and Alan R. Simon. 1993. San Francisco: Morgan Kaufmann Publishers.
xiv
Preface ODBC Reference Microsoft ODBC 3.0 Programmers Reference Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington, 1997
xv
xvi
1
Introduction
The Progress SQL-92 ODBC (Open Database Connectivity) Driver is supplied by MERANT Inc., formerly known as Intersolv. In this manual, the driver will be referred to generically as the Progress SQL-92 ODBC driver. It runs on Windows, Window NT, and UNIX environments. It is installed when you install the Progress SQL-92 Client Access product. This chapter provides a brief overview of the ODBC interface, and describes how the Progress SQL-92 ODBC driver provides access from a wealth of desktop tools to the Progress database.
1.1
Overview of ODBC
The ODBC interface from Microsoft has emerged as the standard mechanism for client applications to access data from a variety of different sources through a single interface. Users of applications that support ODBC merely select a new database from a point-and-click menu to connect, transparently, to data from that data source.
ODBC, Microsofts Open Data Base Connectivity has become the de facto database access standard on the desktop. Desktop tools and applications that support ODBC can access any data source supported by an ODBC driver. These tools include client/server development, query, and personal productivity tools.
To become accessible from ODBC client applications, database environments must provide software, called an ODBC driver, on the client system where the application resides. The driver translates the standard ODBC function calls into calls the data source can process, and returns data to the application. Each data source provides a driver on the client system for applications to use to access data from that source.
1.1.1
The Progress SQL-92 ODBC driver allows tools and applications that support the ODBC call library to use the Progress database as a data source. With it, applications based on tools such as Crystal Reports, PowerBuilder, and Visual Basic can include a Progress database as a data source. The ODBC interface specifies two major components:
A library of function calls that allow applications to connect with a database system and issue statements through an application programming interface (API) Syntax for Structured Query Language (SQL) statements, based on existing standards
12
Introduction
1.1.2
ODBC Architecture
The ODBC driver fits in as a layer of middleware in the ODBC architecture, which includes the following components: Application An ODBC application is any program that calls ODBC functions and uses them to issue SQL statements. Many vendors have added ODBC support to their existing Windows-based tools so those tools can use ODBC for data access. ODBC Driver Manager On Windows platforms, the ODBC driver manager is a Microsoft-supplied dynamic-link library (DLL). On UNIX platforms, the ODBC driver manager is a MERANT-supplied shared library. The driver manager routes calls from an application to the ODBC driver. To an application, the ODBC driver manager and the driver are a single entity that processes requests to the database. The ODBC driver manager loads the requested driver in response to an applications call to the ODBC SQLConnect or SQLDriverConnect functions. ODBC Driver An ODBC driver is a dynamic link library (DLL) or a shared library that processes ODBC function calls for a specific data source. The driver connects to the data source, translates the standard SQL statements into syntax the data source can process, and returns data to the application. There are ODBC drivers for every major database system. Data Source A data source is a combination of a database system, the operating system it uses, and any network software required to access it. ODBC defines a database system (DBMS) as any vendors implementation of a data access system that provides an SQL interface.
13
Progress ODBC Driver Guide Figure 11 shows the components in a Progress ODBC environment.
Any ODBC Application
Progress Database
Figure 11:
14
2
Configuring Progress Data Sources
This chapter describes how to use the ODBC Administrator Utility to add and modify Progress SQL-92 ODBC data sources on Windows client systems. For information on configuring UNIX client systems, see Chapter 4, The UNIX Environment.
2.1
2.1.1
1 Choose Settings Control Panel from the Windows Start menu. The Control Panel displays. 2 Double-click the ODBC icon in the Control Panel:
3 The ODBC Administrator displays the ODBC Data Source Administrator dialog box:
22
4 Click Add to display a list of installed drivers. The Create New Data Source dialog box appears:
5 Highlight the MERANT 3.60 32-BIT Progress SQL-92 ODBC driver, then click Finish to display the ODBC Progress SQL-92 Driver Setup dialog box. 6 Specify values for the following:
Data Source Name Identifies this Progress data source configuration in the system information. Examples include Accounting or 9.1 newsports. Description An optional long description of the data source name. For example, My Accounting Database or Progress 9.1 local newsports. Host Name The name of the system where the database or database broker is located. Port Number The system port number setup for the database listener process.
23
Database Name The name of the database to which you want to connect by default. User ID The default logon ID (user name) used to connect to your Progress database. Your ODBC application may override this value or you may override it in the Logon dialog box or connection string:
24
9 Click Test Connect to attempt to connect to the data source using the connection properties specified in the Driver Setup dialog box. 10 If the driver can connect, it releases the connection and displays a connection established message. Click OK:
11 The ODBC Progress SQL92 Driver Setup dialog box appears. Click Apply:
25
12 Click OK or Cancel to close the Driver Setup dialog box. If you click OK, the values you have specified become the defaults when you connect to the data source. You can change these defaults by using this procedure to reconfigure your data source. You can override these defaults by connecting to the data source using a connection string with alternative values. The data source appears in the ODBC Data Source Administrator:
26
2.1.2
1 Choose Settings Control Panel from the Windows Start menu. The Control panel displays:
2 Double click the ODBC icon in the Control Panel. The ODBC Administrator displays the ODBC Data Source Administrator dialog box:
3 Highlight the User Data Source Name you wish to modify and click Configure. The ODBC Progress SQL-92 Driver Setup dialog box appears.
27
2.1.3
If you click on Test Connect and the driver cannot connect because of an improper environment or incorrect connection value, you receive an error message. Click OK. The following message box appears:
You must verify that the all required client software is properly installed before you can proceed. Refer to the Progress Installation and Configuration Guide Version 9 for Windows for more information.
28
2.1.4
If you click on Test Connect and the driver does connect successfully, the following dialog box appears:
2.2
1 Type the name of the system where the database is stored. 2 Type the Port Number setup for the database listener process. 3 Type the name of the database to which you want to connect. 4 Type your user name. 5 If required, type your password. Password is an optional parameters. You can log on to the database without this parameter, but you may not be able to create, delete, or manipulate the data. 6 Click OK to complete the logon.
29
2.3
DSN=data_source_name[;attribute=value[;attribute=value]...]
Table 21 gives the long and short names for each attribute, as well as a description. The defaults listed in the table are initial defaults that apply when no value is specified in either the connection string or in the data source definition in the system information. If you specified a value for the attribute when configuring the data source, that value is the default. Table 21: Connection String Attributes Attribute Database (DB) DataSourceName (DSN) Description The name of database to which you want to connect. A string that identifies a Progress data source configuration in the system information The name of the system where the database is stored. The default logon ID (user name) used to connect to your Progress database. A logon ID is required only if security is enabled on your database. If so, contact your system administrator to get your logon ID. This ID is case-sensitive. (1 of 2)
210
Configuring Progress Data Sources Table 21: Connection String Attributes Attribute Password (PWD) PortNumber (PORT) Description A case-sensitive password. The system port number setup for the database listener process. (2 of 2)
2.4
2.5
2.6
211
212
3
ODBC API and Scalar Functions
This chapter lists the ODBC API functions that the Progress SQL-92 ODBC driver supports and the scalar functions, which you use in SQL-92 statements.
3.1
API Functions
The Progress SQL-92 ODBC driver is ODBC Level 1-compliantit supports all ODBC Core and Level 1 functions. The driver supports the functions listed below: SQLAllocHandle SQLBindCol SQLBindParameter SQLBulkOperations SQLCancel SQLCloseCursor SQLColAttribute SQLColumns SQLConnect SQLCopyDesc SQLDataSources SQLDescribeCol SQLDisconnect SQLDriverConnect SQLDrivers SQLEndTran SQLExecDirect SQLExecute SQLExtendedFetch (backward and forward scrolling) SQLFetch SQLFetchScroll (backward and forward scrolling) SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName
32
ODBC API and Scalar Functions SQLGetData SQLGetDescField SQLGetDescRec SQLGetDiagField SQLGetDiagRec SQLGetEnvAttr SQLGetFunctions SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQLMoreResults SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPutData NOTE: The MERANT Progress SQL-92 ODBC Driver has an internal limitation of 2 Mg when a user specifies the placement of data through the SQLPutData call.
33
3.2
Scalar Functions
The following tables list the scalar functions that ODBC supports. You can use these functions in SQL statements using the following syntax: SYNTAX
{fn scalar-function}
where scalar-function is one of the functions listed in the following tables. For example:
SELECT {fn UCASE(NAME)} FROM EMP
3.3
String Functions
Table 31 lists the string functions that ODBC supports. The string functions listed can take the following arguments:
can be the name of a column, a string literal, or the result of another scalar function, where the underlying data type is SQL_CHAR or SQL_VARCHAR.
string_exp start, length, and count can be the result of another scalar function or a literal numeric value, where the underlying data type is SQL_TINYINT, SQL_SMALLINT, or SQL_INTEGER.
The string functions are one-based; that is, the first character in the string is character 1. Character string literals must be surrounded in single quotation marks.
34
Table 31:
(1 of 3)
ASCII(string_exp)
ASCII code value of the leftmost character of string_exp as an integer. The length in bits of the string expression. The character with the ASCII code value specified by code. code should be between 0 and 255; otherwise, the return value is data-source dependent. The length in characters of the string expression, if the string expression is of a character data type; otherwise, the length in bytes of the string expression (the smallest integer not less than the number of bits divided by 8). (This function is the same as the CHARACTER_LENGTH function.) The length in characters of the string expression, if the string expression is of a character data type; otherwise, the length in bytes of the string expression (the smallest integer not less than the number of bits divided by 8). (This function is the same as the CHAR_LENGTH function.) The string resulting from concatenating string_exp2 and string_exp1. The string is system dependent. An integer value that indicates the difference between the values returned by the SOUNDEX function for string_exp2 and string_exp1. A string where length characters have been deleted from string_exp1 beginning at start and where string_exp2 has been inserted into string_exp, beginning at start. Uppercase characters in string_exp converted to lowercase. The
count
CONCAT(string_exp1,string_exp)
LCASE(string_exp)
LEFT(string_exp, count)
of characters of string_exp.
35
Progress ODBC Driver Guide Table 31: Scalar String Functions Function
LENGTH(string_exp)
(2 of 3) Returns
The number of characters in string_exp, excluding trailing blanks and the string termination character. The starting position of the first occurrence of string_exp1 within string_exp2. If start is not specified the search begins with the first character position in string_exp2. If start is specified, the search begins with the character position indicated by the value of start. The first character position in string_exp2 is indicated by the value 1. If string_exp1 is not found, 0 is returned. The characters of string_exp, with leading blanks removed. The length in bytes of the string expression. The result is the smallest integer not less than the number of bits divided by 8. The position of the first character expression in the second character expression. The result is an exact numeric with an implementation-defined precision and a scale of 0. A string composed of string_exp repeated count times. Replaces all occurrences of string_exp2 in string_exp1 with string_exp3. The rightmost string_exp.
count
LTRIM(string_exp)
POSITION(character_exp IN character_exp)
REPEAT(string_exp, count)
of characters in
RTRIM(string_exp)
The characters of string_exp with trailing blanks removed. A string consisting of count spaces.
SPACE(count)
36
ODBC API and Scalar Functions Table 31: Scalar String Functions Function
SUBSTRING(string_exp , start, length)
(3 of 3) Returns
A string derived from string_exp beginning at the character position start for length characters. Lowercase characters in string_exp converted to uppercase.
UCASE(string_exp)
3.4
Numeric Functions
Table 32 lists the numeric functions that ODBC supports. The numeric functions listed can take the following arguments:
numeric_exp can be a column name, a numeric literal, or the result of another scalar function, where the underlying data type is SQL_NUMERIC, SQL_DECIMAL, SQL_TINYINT, SQL_SMALLINT, SQL_INTEGER, SQL_FLOAT, SQL_REAL, or SQL_DOUBLE. float_exp
can be a column name, a numeric literal, or the result of another scalar function, where the underlying data type is SQL_FLOAT. can be a column name, a numeric literal, or the result of another scalar function, where the underlying data type is SQL_TINYINT, SQL_SMALLINT, or SQL_INTEGER. Scalar Numeric Functions Function Returns Absolute value of numeric_exp. Arccosine of float_exp as an angle in radians. Arcsine of float_exp as an angle in radians. Arctangent of float_exp as an angle in radians. (1 of 3)
integer_exp
Table 32:
ABS(numeric_exp) ACOS(float_exp)
ASIN(float_exp) ATAN(float_exp)
37
Progress ODBC Driver Guide Table 32: Scalar Numeric Functions Function
ATAN2(float_exp1, float_exp2)
(2 of 3) Returns
Arctangent of the x and y coordinates, specified by float_exp1 and float_exp2 as an angle in radians. Smallest integer greater than or equal to numeric_exp . Cosine of float_exp as an angle in radians. Cotangent of float_exp as an angle in radians. Number of degrees converted from numeric_exp radians. Exponential value of float_exp. Largest integer less than or equal to numeric_exp. Natural log of float_exp Base 10 log of float_exp Remainder of integer_exp1 divided by
integer_exp2
CEILING(numeric_exp)
COS(float_exp) COT(float_exp)
DEGREES(numeric_exp)
EXP(float_exp) FLOOR(numeric_exp)
PI()
Constant value of pi as a floating-point number. Value of numeric_exp to the power of integer_exp. Number of radians converted from numeric_exp degrees. Random floating-point value using integer_exp as the optional seed value.
numeric_exp
POWER(numeric_exp, integer_exp)
RADIANS(numeric_exp)
RAND([ integer_exp
])
ROUND(numeric_exp, integer_exp)
rounded to integer_exp places right of the decimal (left of the decimal if integer_exp is negative).
38
ODBC API and Scalar Functions Table 32: Scalar Numeric Functions Function
SIGN(numeric_exp)
(3 of 3) Returns
Indicator of the sign of numeric_exp. If numeric_exp <0, -1 is returned. If numeric_exp = 0, 0 is returned. If numeric_exp > 0, 1 is returned. Sine of float_exp, where float_exp is an angle in radians. Square root of float_exp. Tangent of float_exp, where float_exp is an angle in radians.
numeric_exp
SIN(float_exp)
SQRT(float_exp) TAN(float_exp)
TRUNCATE(numeric_exp, integer_exp)
truncated to integer_exp places right of the decimal. (If integer_exp is negative, truncation is to the left of the decimal.)
3.5
date-exp can be a column name, a date or timestamp literal, or the result of another scalar
function, where the underlying data type can be represented as SQL_CHAR, SQL_VARCHAR, SQL_DATE, or SQL_TIMESTAMP.
can be a column name, a timestamp or timestamp literal, or the result of another scalar function, where the underlying data type can be represented as SQL_CHAR, SQL_VARCHAR, SQL_TIME, or SQL_TIMESTAMP.
time_exp timestamp_exp
can be a column name; a time, date, or timestamp literal; or the result of another scalar function, where the underlying data type can be represented as SQL_CHAR, SQL_VARCHAR, SQL_TIME, SQL_DATE, or SQL_TIMESTAMP.
39
Table 33:
(1 of 2)
Current local time. The time-precision argument determines the seconds precision of the returned value. Current local date and local time as a timestamp value. The timestamp-precision argument determines the seconds precision of the returned timestamp. Current date as a date value. Current local time as a time value. Character string containing a date source-specific name of the day for the day portion of date_exp. Day of the month in date_exp as an integer value (1-31). Day of the week in date_exp as an integer value (1-7). Day of the year in date_exp as an integer value (1-366). Hour in time_exp as an integer value (0-23). Minute in time_exp as an integer value (0-59). Month in date_exp as an integer value (1-366). Character string containing the data source-specific name of the month. Current date and time as a timestamp value.
DAYOFMONTH(date_exp)
DAYOFWEEK(date_exp)
DAYOFYEAR(date_exp)
HOUR(time_exp) MINUTE(time_exp)
MONTH(date_exp)
MONTHNAME(date_exp)
NOW()
310
ODBC API and Scalar Functions Table 33: Scalar Time and Date Functions Function
QUARTER(date_exp)
(2 of 2) Returns
Quarter in date_exp as an integer value (1-4). Second in date_exp as an integer value (0-59). Timestamp calculated by adding integer_exp intervals of type interval to time_exp. interval can be: SQL_TSI_FRAC_SECOND SQL_TSI_SECOND SQL_TSI_MINUTE SQL_TSI_HOUR SQL_TSI_DAY SQL_TSI_WEEK SQL_TSI_MONTH SQL_TSI_QUARTER SQL_TSI_YEAR Fractional seconds are expressed in billionths of a second.
SECOND(time_exp)
Integer number of intervals of type interval by which time_exp2 is greater than time_exp1. interval has the same values as TIMESTAMPADD. Fractional seconds are expressed in billionths of a second. Week of the year in date_exp as an integer value (1-53). Year in date_exp. The range is data source dependent.
WEEK(date_exp)
YEAR(date_exp)
311
3.6
System Functions
Table 34 lists the system functions that ODBC supports. Table 34: Scalar System Functions Function
DATABASE()
if
exp
is null.
The row identifier of the current row in a table. Authorization name of the user.
USER()
312
4
The UNIX Environment
This chapter describes how to configure the Progress SQL-92 ODBC Driver in the UNIX environment.
4.1
$DLC is an environment variable that points to the directory in which Progress is installed. Using $DLC allows you to use the same script to set environment variables relative to where Progress is installed, regardless of where it is installed on a particular system.
To configure the driver you must set the appropriate environment variables and configure your data source. The following sections contain instructions for completing these tasks.
4.1.1
Table 42 lists the environment variables you must set to configure the ODBC driver and the location to which you must set them (the directory containing the ODBC Driver libraries), by platform. Table 42: ODBC Driver Environment Variables Environment Variable LD_LIBRARY_PATH LIBPATH SHLIB_PATH Location
$DLC/odbc/lib $DLC/odbc/lib $DLC/odbc/lib
42
4.1.2
In the UNIX environment, there is no ODBC Administrator. To configure a data source, you must edit the system information file, a plain text file that is normally located in the $HOME directory and is usually called .odbc.ini.
4.1.3
The system information file is maintained using any text editor to define data source entries as described in Chapter 2, Configuring Progress Data Sources. A sample odbc.ini file is located in $DLC/odbc.
4.1.4
43
Progress ODBC Driver Guide The library file names in the system information file vary by platform. Table 43 lists the Driver and Tracing library names by platform. Table 43: System Information File Entries by Platform Driver Library Name
pgpro915.so pgpro915.a pgpro915.sl
4.1.5
UNIX support of the ODBC driver permits the use of a centralized system information file that a system administrator can control. This is accomplished by setting the environment variable ODBCINI to point to the fully qualified pathname of the centralized file. For example, in the C shell you could set this variable as follows:
setenv ODBCINI /dlc/odbc/odbc.ini
ODBCINI is an environment variable that the Progress SQL-92 ODBC driver will recognize. You can set ODBCINI to use a system information file other than the default file. You can have multiple system information files and change the ODBCINI environment variable to point to the one you want to use. The search order for the location of the system information file is as follows: 1. 2. Check ODBCINI Check $HOME for .odbc.ini
44
The UNIX Environment There must be an [ODBC] section in the system information file that includes the InstallDir keyword. The value of this keyword must be the path to the directory under which the /lib and /messages directories are contained. For example, if you choose the default install directory, then the following line must be in the [ODBC] section:
InstallDir=/dlc/odbc
4.2
Setting the appropriate library search path environment variable (LD_LIBRARY_PATH on Solaris, SHLIB_PATH on HP/UX, or LIBPATH on AIX) enables the ODBC application to locate the ODBC core components and drivers at the time of execution. Alternatively, you can set the ODBC environment variable and then run the script $DLC/bin/slibod_env:
$ DLC/bin/proenv . $DLC/bin/slibod_env
45
4.3
1 Add the following line at the very beginning of applications that use double-byte character sets:
This is a standard UNIX function. It selects the character set indicated by the environment variable LANG as the one to be used by X/Open compliant character handling functions. If this line is not present, or if LANG is either not set or is set to NULL, the default locale "C" is used.
2 Set the LANG environment variable to the appropriate character set. The UNIX command locale -a can be used to display all supported character sets on your system.
For more information, see the man pages for locale and setlocale.
4.4
Translators
Progress provides a sample translator named OEM to ANSI that provides a framework for coding a translation library. Table 45 lists the Translation keyword options. You must add the TranslationSharedLibrary keyword to the data source section of the system information file to perform a translation. Adding the TranslationOption keyword is optional. Table 45: Translators Keyword TranslationSharedLibrary TranslationOption Definition Full path of translation library ASCII representation of the 32-bit integer translation option
46
A
SQLGetInfo
This appendix shows information the Progress SQL-92 ODBC Driver returns to SQLGetInfo.
Progress ODBC Driver Guide Table A1 describes return values to SQLGetInfo from the Progress SQL-92 ODBC driver. Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (1 of 27) fInfoType Argument SQL_ACCESSIBLE _PROCEDURES N Returns
Description Guaranteed execute privileges on all procedures returned by SQLProcedures Guaranteed read access to all table names returned by SQLTables Maximum number of active connections Maximum number of active statements supported for an active connection Maximum number of active environments Support for ALTER DOMAIN statement Support for ALTER TABLE clauses SQL Conformance Support for datetime literals Level of asynchronous mode support
SQL_ACCESSIBLE_TABLES
0x00000000
SQL_ALTER_TABLE
0x00000000
A2
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (2 of 27) fInfoType Argument SQL_BATCH_ROW_COUNT Returns 0x00000000
Description Behavior with respect to the availability of row counts in batches Support for batches Support for bookmarks Position of qualifier in a qualified table name Support for catalog names Character used to separate table, column qualifiers Term for object that qualifies table names Statements that support qualifiers Default collation sequence name for the default character set Support for column aliases Result of concatenation of NULL character column with non-NULL column
SQL_CATALOG_USAGE SQL_COLLATION_SEQ
0x00000000
Y SQL_CB_NULL = 0
A3
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (3 of 27) fInfoType Argument SQL_CONVERT_BIGINT Returns SQL_CVT_CHAR SQL_CVT_BIGINT SQL_CVT_TINYINT SQL_CVT_SMALLINT SQL_CVT_INTEGER SQL_CVT_FLOAT SQL_CVT_DOUBLE 0x00000000 0x00000000 SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_DATE SQL_CVT_TIME SQL_CVT_TIMESTAMP SQL_CVT_CHAR SQL_CVT_VARCHAR SQL_CVT_DATE SQL_CVT_TIMESTAMP
SQL_CONVERT_DATE
A4
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (4 of 27) fInfoType Argument SQL_CONVERT_DECIMAL Returns SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_FN_CVT_CONVERT
SQL_CONVERT_DOUBLE
SQL_CONVERT_FLOAT
SQL_CONVERT_FUNCTIONS
A5
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (5 of 27) fInfoType Argument SQL_CONVERT_INTEGER Returns SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT 0x00000000
Conversion from INTERVAL_DAY _TIME Conversion from INTERVAL_YEA R_MONTH Conversion from LONGVARBINA RY Conversion from LONGVARCHAR Conversion from NUMERIC
0x00000000
0x00000000
0x00000000 SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT
A6
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (6 of 27) fInfoType Argument SQL_CONVERT_REAL Returns SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_CHAR SQL_CVT_TIME SQL_CVT_TIMESTAMP SQL_CVT_CHAR SQL_CVT_VARCHAR SQL_CVT_DATE SQL_CVT_TIME SQL_CVT_TIMESTAMP
SQL_CONVERT_SMALLINT
SQL_CONVERT_TIME
SQL_CONVERT_TIMESTAMP
A7
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (7 of 27) fInfoType Argument SQL_CONVERT_TINYINT Returns SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT 0x00000000 SQL_CVT_CHAR SQL_CVT_NUMERIC SQL_CVT_DECIMAL SQL_CVT_INTEGER SQL_CVT_SMALLINT SQL_CVT_FLOAT SQL_CVT_REAL SQL_CVT_DOUBLE SQL_CVT_VARCHAR SQL_CVT_TINYINT SQL_CVT_BIGINT SQL_CVT_DATE SQL_CVT_TIME SQL_CVT_TIMESTAMP 0x00000000 0x00000000
Conversion from WCHAR Conversion from WLONGVAR CHAR Conversion from WVARCHAR Support for table correlation names
0x00000000 SQL_CN_DIFFERENT
A8
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (8 of 27) fInfoType Argument SQL_CREATE_ASSERTION Returns 0x00000000
Description Support for CREATE ASSERTION statement Support for CREATE CHARACTER SET statement Support for CREATE COLLATION statement Support for CREATE DOMAIN statement Support for CREATE SCHEMA statement Support for CREATE TABLE statement
0x00000000
SQL_CREATE_COLLATION
0x00000000
SQL_CREATE_DOMAIN
0x00000000
SQL_CREATE_SCHEMA
0x00000000
SQL_CREATE_TABLE
Support for CREATE TRANSLATION statement Support for CREATE VIEW statement
SQL_CREATE_ TRANSLATION
SQL_CREATE_VIEW
SQL_CV_CREATE_VIEW SQL_CV_CHECK_OPTION
A9
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (9 of 27) fInfoType Argument SQL_CURSOR_COMMIT_ BEHAVIOR Returns SQL_CB_PRESERVE
Description Effect of COMMIT operation on cursors and prepared statements Effect of ROLLBACK operation on cursors and prepared statements Support for cursor sensitivity Name of the data source as specified to the ODBC Administrator Access limited to read-only Name of the Progress SQL-92 ODBC data source on the server system Name of the database product supporting the data source Version of the database product Default transaction isolation level
SQL_CURSOR_ROLLBACK _BEHAVIOR
0x00000000
SQL_CURSOR_SENSITIVITY SQL_DATA_SOURCE_NAME
SQL_DBMS_NAME
PROGRESS
A10
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (10 of 27) fInfoType Argument SQL_DESCRIBE_ PARAMETER Returns Y (supports)
Description Support for describing parameters via DESCRIBE INPUT statement Version of the driver manager Connection handle determined by the argument InfoType Drivers descriptor handle determined by the Driver Managers descriptor handle Environment handle determined by the argument InfoType Handle library from the load library returned to the Driver Manager when it loaded the driver DLL Drivers statement handle determined by the Driver Managers statement handle Name of the dynamic link library file for the ODBC Driver
SQL_DM_VER SQL_DRIVER_HDBC
03.51.37110.0000 0x0013EBE0
SQL_DRIVER_HDESC
0x0013F820
SQL_DRIVER_HENV
0x0013C8A0
SQL_DRIVER_HLIB
0x28660000
SQL_DRIVER_HSTMT
0x001427E0
SQL_DRIVER_NAME
PGPRO915.DLL
A11
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (11 of 27) fInfoType Argument SQL_DRIVER_ODBC_VER SQL_DRIVER_VER SQL_DROP_ASSERTION 03.51 03.60.0000 0x00000000 Returns
Description Supported ODBC version Current version of the ODBC Driver Support for DROP ASSERTION statement Support for DROP CHARACTER SET statement Support for DROP COLLATION statement Support for DROP DOMAIN statement Support for DROP SCHEMA statement Support for DROP TABLE statement Support for DROP TRANSLATION statement Support for DROP VIEW statement Supported attributes of a dynamic cursor: subset 1
0x00000000
0x00000000
SQL_DROP_DOMAIN
0x00000000
SQL_DROP_SCHEMA
0x00000000
SQL_DROP_TABLE SQL_DROP_TRANSLATION
SQL_DT_DROP_TABLE 0x00000000
SQL_DT_DROP_VIEW 0x00000000
A12
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (12 of 27) fInfoType Argument SQL_DYNAMIC_CURSOR_ ATTRIBUTES2 Returns 0x00000000
Description Supported attributes of a dynamic cursor: subset 2 Support for expressions in ORDER BY clause Supported fetch direction options
SQL_FD_FETCH_NEXT SQL_FD_FETCH_FIRST SQL_FD_FETCH_LAST SQL_FD_FETCH_PRIOR SQL_FD_FETCH_ ABSOLUTE SQL_FD_FETCH_ RELATIVE SQL_FD_FETCH_ BOOKMARK SQL_FILE_NOT _SUPPORTED SQL_CA1_NEXT SQL_CA1_BULK_ADD
Single-tier driver behavior Supported attributes of a forward-only cursor: subset 1 Supported attributes of a forward-only cursor: subset 2 Supported extensions to SQLGetData Relationship between GROUP BY clause and columns in the select list
SQL_FORWARD_ONLY_ CURSOR_ATTRIBUTES2
A13
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (13 of 27) fInfoType Argument SQL_IDENTIFIER_CASE Returns SQL_IC_UPPER
Description Case sensitivity of user-supplied names Character used to enclose delimited identifiers Keywords supported in the CREATE INDEX statement Supported views in INFORMATION_ SCHEMA Support for Integrity Enhancement Facility Supported attributes of a keyset cursor: subset 1
SQL_IK_ASC | SQL_IK_DESC
SQL_INFO_SCHEMA_VIEWS
0x00000000
SQL_INTEGRITY
SQL_KEYSET_CURSOR_ ATTRIBUTES1
SQL_CA1_NEXT SQL_CA1_ABSOLUTE SQL_CA1_RELATIVE SQL_CA1_BOOKMAR K SQL_CA1_LOCK_NO_ CHANGE SQL_CA1_POS_POSITION SQL_CA1_POS_UPDATE SQL_CA1_POS_DELETE SQL_CA1_POS_REFRESH SQL_CA1_POSITIONED _UPDATE SQL_CA1_POSITIONED _DELETE SQL_CA1_SELECT_FOR _UPDATE SQL_CA1_BULK_ADD
A14
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (14 of 27) fInfoType Argument SQL_KEYSET_CURSOR_ ATTRIBUTES2 Returns SQL_CA2_READ_ONLY_ CONCURRENCY SQL_CA2_OPT_VALUES _CONCURRENCY SQL_CA2_SENSITIVITY _DELETIONS SQL_CA2_SENSITIVITY _UPDATES SQL_CA2_MAX_ROWS _SELECT SQL_CA2_CRC_EXACT SQL_CA2_SIMULATE _TRY_UNIQUE See the Progress SQL-92 Guide and Reference for a list of SQL Keywords. Y
Data source specific keywords Support for escape clause in LIKE predicates Support for lock types Maximum number of active concurrent statements in asynchronous mode Maximum length in hexadecimal characters of binary literals Maximum length of a table or column qualifier
SQL_KEYWORDS
SQL_LIKE_ESCAPE_CLAUSE
SQL_LCK_NO_CHANGE 0
SQL_MAX_BINARY_ LITERAL_LEN
31995
SQL_MAX_CATALOG_NAME _LEN
A15
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (15 of 27) fInfoType Argument SQL_MAX_CHAR_LITERAL_ LEN 31995 Returns
Description Maximum length in characters of character string literals Maximum length of a column name Maximum number of columns allowed in GROUP BY clause Maximum number of columns allowed in an index Maximum number of columns allowed in ORDER BY clause Maximum number of columns allowed in a select list Maximum number of columns allowed in a table Maximum number of active SQL statements Maximum length of a cursor name Maximum number of active connections
32 499
16
SQL_MAX_COLUMNS_IN _SELECT SQL_MAX_COLUMNS_IN _TABLE SQL_MAX_CONCURRENT _ACTIVITIES SQL_MAX_CURSOR_NAME _LEN SQL_MAX_DRIVER _CONNECTIONS
500
500
0 (no maximum)
18 0
A16
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (16 of 27) fInfoType Argument SQL_MAX_IDENTIFIER_LEN SQL_MAX_INDEX_SIZE 32 115 Returns
Description Maximum length of user-defined names Maximum number of bytes allowed in the combined fields of an index Maximum length of a procedure name Maximum length in bytes of a table row Whether maximum row size includes LONGVARCHAR and LONGVARBINA RY Maximum length of an owner name Maximum number of characters in an SQL statement Maximum length of a table name Maximum number of tables allowed in FROM clause Maximum length of a user name Maximum length of owner name
32 0 N
SQL_MAX_SCHEMA_NAME _LEN SQL_MAX_STATEMENT_ LEN SQL_MAX_TABLE_NAME_ LEN SQL_MAX_TABLES_IN_ SELECT SQL_MAX_USER_NAME_ LEN SQL_MAX_OWNER_NAME_ LEN
32 131000
32 250
32 32
A17
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (17 of 27) fInfoType Argument SQL_MAX_QUALIFIER_ NAME_LEN SQL_MULT_RESULT_SETS SQL_MULTIPLE_ACTIVE _TXN 0 N Y Returns
Description Maximum length of a qualifier name Support for multiple result sets Support for active transactions on multiple connections Whether data source requires length of LONGVARCHAR and LONGVARBINA RY data Support for NOT NULL clause in CREATE TABLE statement Where null values are sorted in a list
SQL_NEED_LONG_DATA _LEN
SQL_NON_NULLABLE _COLUMNS
SQL_NNC_NON_NULL
SQL_NULL_COLLATION
SQL_NC_LOW
A18
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (18 of 27) fInfoType Argument SQL_NUMERIC_FUNCTIONS Returns SQL_FN_NUM_ABS SQL_FN_NUM_ACOS SQL_FN_NUM_ASIN SQL_FN_NUM_ATAN SQL_FN_NUM_ATAN2 SQL_FN_NUM_CEILING SQL_FN_NUM_COS SQL_FN_NUM_EXP SQL_FN_NUM_FLOOR SQL_FN_NUM_MOD SQL_FN_NUM_PI SQL_FN_NUM_POWER SQL_FN_NUM_RADIANS SQL_FN_NUM_RAND SQL_FN_NUM_ROUND SQL_FN_NUM_SIGN SQL_FN_NUM_SIN SQL_FN_NUM_SQRT SQL_FN_NUM_TAN SQL_FN_NUM_DEGREES SQL_FN_NUM_LOG10 SQL_OAC_LEVEL1 SQL_OIC_CORE
Level of ODBC conformance Level of ODBC 3.x interface conformance SQL Access Group (SAG) conformance Level of SQL conformance Referential integrity syntax support
SQL_OSCC_COMPLIANT
SQL_OSC_EXTENDED Y
A19
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (19 of 27) fInfoType Argument SQL_ODBC_VER Returns 03.51.0000
Description ODBC version supported by driver manager Types of outer joins supported
SQL_OJ_CAPABILITIES
Whether columns in ORDER BY clause must also be in select list Support for outer joins Name for an owner Statements in which owner may be used
SQL_ORDER_BY_COLUMNS _IN_SELECT
Y owner SQL_OU_DML _STATEMENTS SQL_OU_PROCEDURE _INVOCATION SQL_OU_TABLE _DEFINITION SQL_OU_INDEX _DEFINITION SQL_OU_PRIVILEGE _DEFINITION SQL_PARC_NO_BATCH
Characteristics of row counts available in a parameterized execution Characteristics of result sets available in a parameterized execution
SQL_PARAM_ARRAY_ROW _COUNTS
SQL_PARAM_ARRAY_ SELECTS
SQL_PAS_NO_SELECT
A20
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (20 of 27) fInfoType Argument SQL_POS_OPERATIONS Returns SQL_POS_POSITION SQL_POS_REFRESH SQL_POS_UPDATE SQL_POS_DELETE SQL_POS_ADD SQL_PS_POSITIONED _DELETE SQL_PS_POSITIONED _UPDATE SQL_PS_SELECT_FOR _UPDATE procedure Y 0x00000000 SQL_IC_MIXED
SQL_POSITIONED_ STATEMENTS
Term for procedures SQL procedures support Support for qualifiers Case sensitivity of quoted user-supplied names Separator character used between qualifier name and element Term used for a qualifier Position of the qualifier in a qualified table name
SQL_QUALIFIER_NAME _SEPARATOR
SQL_QUALIFIER_TERM SQL_QUALIFIER_LOCATION
A21
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (21 of 27) fInfoType Argument SQL_ROW_UPDATES Y Returns
Description Detect changes to any row in mixed-cursor operations Term for entity that has owner privileges on objects Statements that support use of owner qualifiers
SQL_SCHEMA_TERM
owner
SQL_SCHEMA_USAGE
SQL_OU_DML_ STATEMENTS SQL_OU_PROCEDURE _INVOCATION SQL_OU_TABLE _DEFINITION SQL_OU_INDEX _DEFINITION SQL_OU_PRIVILEGE _DEFINITION SQL_SO_FORWARD _ONLY SQL_SO_STATIC SQL_SO_KEYSET_DRIVEN SQL_SCCO_READ_ONLY SQL_SCCO_OPT_VALUES \ (backslash)
Options supported for scrollable cursors Support for scrollable cursors Character to permit wildcard characters in search strings Name of the system where the Progress SQL-92 ODBC data source resides Special characters allowed in user-supplied names
SQL_SCROLL_OPTIONS
SQL_SPECIAL_ CHARACTERS
_, %
A22
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (22 of 27) fInfoType Argument SQL_SQL92_DATETIME _FUNCTIONS SQL_SQL92_FOREIGN_KEY _DELETE_RULE Returns 0x00000000 0x00000000
Description Datetime scalar functions supported Behavior of DELETE statement that refers to a foreign key Behavior of UPDATE statement that refers to a foreign key GRANT statement clauses supported
SQL_SQL92_FOREIGN_KEY _UPDATE_RULE
0x00000000
SQL_SQL92_GRANT
SQL_SG_DELETE_TABLE SQL_SG_INSERT_TABLE SQL_SG_INSERT _COLUMN SQL_SG_REFERENCES _TABLE SQL_SG_REFERENCES _COLUMN SQL_SG_SELECT_TABLE SQL_SG_UPDATE _TABLE SQL_SG_UPDATE _COLUMN SQL_SNVF_CHAR _LENGTH SQL_SNVF_CHARACTER _LENGTH SP_EXISTS SQL_SP_ISNOTNULL SQL_SP_ISNULL SQL_SP_UNIQUE SQL_SP_LIKE SQL_SP_IN SQL_SP_BETWEEN 0x00000000
SQL_SQL92_NUMERIC_ VALUE_FUNCTIONS
Predicates supported
SQL_SQL92_PREDICATES
SQL_SQL92_RELATIONAL _JOIN_OPERATORS
A23
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (23 of 27) fInfoType Argument SQL_SQL92_REVOKE Returns SQL_SR_GRANT_ OPTION_FOR SQL_SR_CASCADE SQL_SR_DELETE_TABLE SQL_SR_INSERT_TABLE SQL_SR_INSERT _COLUMN SQL_SR_REFERENCES _TABLE SQL_SR_REFERENCES _COLUMN SQL_SR_SELECT_TABLE SQL_SR_UPDATE _TABLE SQL_SR_UPDATE _COLUMN 0x00000000
SQL_SQL92_ROW_VALUE _CONSTRUCTOR
SQL_SQL92_STRING _FUNCTIONS
SQL_SSF_CONVERT SQL_SSF_LOWER SQL_SSF_UPPER SQL_SSF_SUBSTRING SQL_SSF_TRANSLATE SQL_SSF_TRIM _LEADING SQL_SSF_TRIM_TRAILING SQL_SVE_COALESCE SQL_SVE_NULLIF SQL_SCC_XOPEN_CLI _VERSION1
A24
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (24 of 27) fInfoType Argument SQL_STATIC_CURSOR _ATTRIBUTES1 Returns SQL_CA1_NEXT SQL_CA1_ABSOLUTE SQL_CA1_RELATIVE SQL_CA1_BOOKMARK SQL_CA1_LOCK_NO _CHANGE SQL_CA1_POS_POSITION SQL_CA1_POS_UPDATE SQL_CA1_POS_DELETE SQL_CA1_POS_REFRESH SQL_CA1_POSITIONED _UPDATE SQL_CA1_POSITIONED _DELETE SQL_CA1_SELECT_FOR _UPDATE SQL_CA1_BULK_ADD SQL_CA2_READ_ONLY _CONCURRENCY SQL_CA2_OPT_VALUES _CONCURRENCY SQL_CA2_CRC_EXACT SQL_CA2_SIMULATE _TRY_UNIQUE 0x00000000
SQL_STATIC_CURSOR _ATTRIBUTES2
Support for detection of changes made to a static or key-set driven cursor through SQLSetPos
SQL_STATIC_SENSITIVITY
A25
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (25 of 27) fInfoType Argument SQL_STRING_FUNCTIONS Returns SQL_FN_STR_CONCAT SQL_FN_STR_INSERT SQL_FN_STR_LEFT SQL_FN_STR_LTRIM SQL_FN_STR_LENGTH SQL_FN_STR_LOCATE SQL_FN_STR_LCASE SQL_FN_STR_REPEAT SQL_FN_STR_REPLACE SQL_FN_STR_RIGHT SQL_FN_STR_RTRIM SQL_FN_STR _SUBSTRING SQL_FN_STR_UCASE SQL_FN_STR_ASCII SQL_FN_STR_CHAR SQL_FN_STR _DIFFERENCE SQL_FN_STR_LOCATE_2 SQL_FN_STR_SPACE SQL_FN_STR_CHAR _LENGTH SQL_FN_STR _CHARACTER_LENGTH SQL_SQ_COMPARISON SQL_SQ_EXISTS SQL_SQ_IN SQL_SQ_QUANTIFIED SQL_FN_SYS _USERNAME table 0x00000000
SQL_SUBQUERIES
System functions supported Term for tables Timestamp intervals supported for TIMESTAMPAD D function
A26
SQLGetInfo Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (26 of 27) fInfoType Argument SQL_TIMEDATE_DIFF _INTERVALS Returns 0x00000000
Description Timestamp intervals supported for TIMESTAMPDIF F function Date-time functions supported
SQL_TIMEDATE_ FUNCTIONS
SQL_FN_TD_NOW SQL_FN_CURDATE SQL_FN_TD _DAYOFMONTH SQL_FN_TD _DAYOFWEEK SQL_FN_TD _DAYOFYEAR SQL_FN_TD_MONTH SQL_FN_TD_QUARTER SQL_FN_TD_WEEK SQL_FN_TD_YEAR SQL_FN_CURTIME SQL_FN_TD_HOUR SQL_FN_TD_MINUTE SQL_FN_TD_SECOND SQL_FN_TD _TIMESTAMP_ADD SQL_FN_TD _TIMESTAMPDIFF SQL_FN_TD_DAYNAME SQL_FN_TD _MONTHNAME SQL_TC_ALL
Support for DML, DDL within transactions Options for setting transaction isolation levels
SQL_TXN_CAPABLE
SQL_TXN_ISOLATION_ OPTION
A27
Progress ODBC Driver Guide Table A1: Information the Progress SQL-92 ODBC Driver Returns to SQLGetInfo (27 of 27) fInfoType Argument SQL_UNION SQL_USER_NAME Returns SQL_U_UNION SQL_U_UNION_ALL (string containing the name)
Description UNION support Name of user connected to the data source Year of publication of the X/Open specification with which the driver complies
SQL_XOPEN_CLI_YEAR
1995
A28
B
Progress and ODBC Data Types
This appendix shows how the Progress data types are mapped to the standard ODBC data types.
Progress ODBC Driver Guide Table B1 shows how the Progress data types are mapped to the standard ODBC data types. Table B1: Progress and ODBC Data Types ODBC Data Type SQL_BINARY SQL_BIT SQL_CHAR SQL_TYPE_DATE SQL_DECIMAL SQL_DOUBLE SQL_FLOAT SQL_INTEGER SQL_FLOAT SQL_SMALLINT SQL_TYPE_TIME SQL_TYPE_TIMESTAMP SQL_TINYINT SQL_VARBINARY SQL_LONGVARBINARY SQL_VARCHAR
Progress Data Type Binary Bit Char Date Decimal Double Precision Float Integer Real Smallint Time Timestamp Tinyint Varbinary Lvarbinary Varchar
B2
Glossary
Add [an ODBC data source] Make a data source available to ODBC through the Add operation of the ODBC Administrator. Adding a data source tells ODBC where a specific database resides and which ODBC driver to use to access it. Adding a data source also invokes a setup dialog box for the particular driver so you can provide other details the driver needs to connect to the database. Client In client/server systems, the part of the system that sends requests to servers and processes the results of those requests. Data Source See ODBC Data Source. Delete [an ODBC data source] Removes information about an ODBC data source through the Delete operation of the ODBC Administrator utility. Deleting a data source does not delete the database it corresponds to, but removes information about the databases location from the \%WINDIR%\ODBC.INI file. Delimited Identifiers Names in SQL statements that are enclosed in double quotation marks ("). Enclosing a name in double quotation marks preserves the case of the name and allows it to include reserved words and special characters. Subsequent references to a delimited identifier must also use enclosing double quotation marks. ODBC Administrator Microsoft-supplied utility to add and delete ODBC data sources and drivers. The installation procedure installs the Administrator if it is not already present on a system. To invoke it, click on the ODBC icon in the Control Panel applications of the Windows Program Manager.
Progress ODBC Driver Guide ODBC Application Any program that calls ODBC functions and uses them to issue SQL statements. Many vendors have added ODBC capabilities to their existing Windows-based tools. ODBC Data Source In ODBC terminology, a specific combination of a database system, the operating system it uses, and any network software required to access it. Before applications can access a database through ODBC, you use the ODBC Administrator to add a data sourceregister information about the database and an ODBC driver that can connect to itfor that database. More than one data source name can refer to the same database, and deleting a data source does not delete the associated database. ODBC Driver Software that processes ODBC function calls for a specific data source. The driver connects to the data source, translates the standard SQL statements into syntax the data source can process, and returns data to the application. ODBC Driver Manager A Microsoft-supplied program that routes calls from an application to the appropriate ODBC driver for a data source. SQL Engine The core internal component of Progress SQL-92. The SQL engine receives requests from the Progress SQL-92 ODBC driver, processes them, and returns results.
Glossary2
Index
A
Audience vii
Data Types how progress maps B2 ODBC B2 standard B2 DLC/lib 45 Driver ODBC 13 Driver Manager ODBC 13, 22
B
Bold typeface as typographical convention viii
C
Connecting connection string attributes 210 using a connection string 210 using a logon dialog box 29 Connection String Attibutes 210
E
environment variables LD_LIBRARY_PATH 42 LIBPATH 42 PATH 42 SHLIB_PATH 42
D
Data Source adding 22 configuring 22 definition 13 modifying 27 Data Source Name 23
F
Failure test connect 28 Functions API 32 date 39 numeric 37 ODBC API 31
Progress ODBC Driver Guide scalar 31, 34 date 310 numeric 37 string 35 system 312 time 310 string 34 system 312 time 39
M
Manual organization of vii syntax notation ix Monospaced typeface as typographical convention ix
I
Italic typeface as typographical convention viii
O
ODBC API functions 31 application 13 architecture 13 components 14 data source 13 driver 13 driver manager 13, 22 environment 14 interface 12 Open Database Connectivity 11 overview 12 ODBC Administrator 22, 27 Create New Data Source dialog box 23 Data Source dialog box 22, 27 Driver Setup dialog box 23, 27 ODBC Driver 42 libodbc.a 42, 44 libodbc.sl 42, 44 libodbc.so 42, 44 odbctrac.a 44 odbctrac.sl 44 odbctrac.so 44 ODBC Driver Directory 42 odbctrac.a 44 odbctrac.sl 44 odbctrac.so 44
K
Keystrokes ix
L
LD_LIBRARY_PATH 42 Levels isolation 211 lock 211 ODBC Conformance 211 libodbc.a 42, 44 libodbc.sl 42, 44 libodbc.so 42, 44 LIBPATH 42 Logon using a connection string 210 using logon dialog box 29
Index2
Index
P
Problems test connect failure 28
connections 211 isolation levels 211 lock levels 211 statements 211 Syntax notation ix
S
SHLIB_PATH 42 SQLGetInfo A1 information returned A2 to A28 Support for
T
Test Connect failure 28 Typographical conventions viii
Index3
Index4