Progress
Embedded SQL-92
Guide and Reference
Preface
Purpose
The manual describes the syntax and semantics of the Progress Embedded SQL-92 language statements.
Audience
This manual is intended for application developers writing database applications using the Progress Embedded SQL-92 environment. See also the Progress SQL-92 Guide and Reference .
Organization of This Manual
Introduces the concept of embedding SQL statements in a host language and the advantages of using embedded SQL.
Provides a description of how to invoke the ESQLC command, including ESQLC command syntax and options. Lists platform-specific requirements.
Describes the overall structure of an ESQL program, including the DECLARE SECTION, host variables, and types of ESQL executable statements.
"Connection Management in ESQL-92"
Describes connection management statements in ESQL.
"SQL-92 Data Definition Statements"
Introduces the data definition statements (DDL) that can be used in an ESQL program and gives a description of integrity constraints that can be used in DDL statements.
"SQL-92 Data Manipulation Statements"
Describes using Data Manipulation statements (DML) in ESQL programs and discusses the types of DML statements.
Describes SQL queries and their use in ESQL programs. Introduces the SELECT statement and discusses the query statements with host variables.
"Handling NULL Values in ESQL-92"
Describes how to handle NULL values in ESQL and discusses inserting and retrieving NULL values.
Describes handling errors in ESQL and discusses the use of the SQLCA, the WHENEVER statement, and indicator variables for error handling.
"Dynamic SQL Management in ESQL-92"
Describes the combinations of steps required to process an SQL-92 statement using dynamic SQL.
"Transaction Management in ESQL-92"
Describes transaction management in ESQL and explains how to start and end a transaction, set transaction isolation levels, and manage locking in transactions.
"Guidelines for Developing ESQL-92 Applications"
Contains some general guidelines for developing ESQL applications.
"Handling Data Types in ESQL-92"
Describes the data types that are available in an ESQL application program and discusses mechanisms for data conversions and data comparisons.
Provides syntax, examples, and reference information on statements used for processing embedded SQL-92 statements.
Complete code listings of ESQL-92 sample programs.
Program Name Sample Program Illustrates Static SQL-92 UPDATE Statement Static SQL-92 SELECT Statement Dynamic SQL-92 non-SELECT Statement Dynamic SQL-92 SELECT Statement
"Compile, Link, and Run-time Requirements"
This appendix lists compile, link, and run time requirements for using the Embedded SQL-92 precompiler for C.
How to Use This Manual
Use this manual as a reference for Progress Embedded SQL-92 and as a guide to building and compiling Progress Embedded SQL-92 applications. This manual is not a reference for the C programming language. For information on supported SQL language elements and statements see the Progress SQL-92 Guide and Reference .
Typographical Conventions
This manual uses the following typographical conventions:
The following typographical conventions are used to represent keystrokes:
- 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-LEFTSyntax 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:
- 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.
In this syntax example the first user_name is required, and additional user_name specifications are optional:
NOTE: The ellipsis (...) indicates repetition, as shown in a following description.
- 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:
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:
- 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:
In the DELETE FROM example, you must specify one of table_name or view_name:
- 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:
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:
- 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.
In this example, CREATE VIEW is followed by several optional items:
Other Useful Documentation
This section lists Progress Software Corporation documentation that you might find useful. Unless otherwise specified, these manuals support both Windows and Character platforms and are provided in electronic documentation format on CD-ROM.
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.
Progress Installation and Configuration Guide Version 9 for UNIX
A manual that describes how to install and set up Progress Version 9.1 for the UNIX operating system.
Progress Installation and Configuration Guide Version 9 for Windows
A manual that describes how to install and set up Progress Version 9.1 for all supported Windows and Citrix MetaFrame operating systems.
Progress Version 9 Product Update Bulletin
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 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.
Progress Startup Command and Parameter Reference
A reference manual that describes the Progress startup commands and parameters in alphabetical order.
Development Tools
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.
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.
SQL-92
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.
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.
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.
Reference
Pocket Progress (Hard copy only)
A reference that lets you quickly look up information about the Progress language or programming environment.
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.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |