GNADE User's Guide

GNADE, The GNat Ada Database Environment

Version 1.5.0

Document Revision $Revision: 1.42 $

Edited by

Michael Erdmann

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being "The GNat Ada Database Environment". A copy of the license is included in the section entitled "GNU Free Documentation License".


Table of Contents
Preface
I. Introduction
1. Project Objectives
2. Software License
3. Trademarks
4. Supported Databases and OS platforms
5. Getting started
Installation on Unix like systems
Installation on Windows NT
Add on packages
General Installation Hints
6. Using the release with your database
If your data base is not supported
Installation of the ODBC Interface
Prepared Example Programs
7. Contact
8. Authors
II. GNU Embedded SQL Translator for Ada 95
9. Introduction to Embedded SQL
10. Embedded SQL Syntax Specification
The GNU Ada 95 Embedded SQL
Embedded SQL statement
SQL Query and FETCH clause
Embedded SQL declare section
Embedded Exception Declaration
Handling of return codes
SQL Communication Area
Connection Handling
Cursor Handling
Mixing ODBC and embedded SQLcode
Dynamic SQL
GNADE Specific Datatypes
11. The ESQL Translator
Compilation Process
Invocation of the GNU ESQL Translator (gesql)
12. Building Applications using ESQL
Using ESQL with make
Additional command Line Interface Options
Redirecting ESQL Support output
III. ODBC bindings for Ada 95
13. Introduction to ODBC
14. Using the Ada 95 ODBC Bindings
General remarks
A minimal odbc example
Implemented ODBC methods
15. Building ODBC based programs
16. Ada95 aspects of the ODBC binding
IV. Native Bindings
17. Introduction to native bindings
18. MySQL bindings
The MYSQL API
Building programs with MySQL
19. Postgres bindings
V. ADBC - Ada Database Connectivity
20. Introduction
21. Basic Concepts
Hostvariables
Statements
Resultset
22. Using the ADO Interface
A Sample Application
Building a Sample Application
Things to know
VI. OCI - Oracle Call Interface
23. Introduction
24. Basic Concepts
Hostvariables
Statements
Resultset
25. Using the OCI packages
A Sample Application
Building a Sample Application
Things to know
VII. GNADE command line tools
26. Introduction
27. lsodbc - Display data source information
28. sql - execute an sql command
29. exp - export a table from a data base
30. imp - import data into a table from export files
VIII. GNADE and the GPS from ACT
31. Introduction
32. GPS Project Files
A. Frequently asked questions
Q: How to setup an application development environment
Q: How can i use GPS with GNADE
Q: How to handle strings in where clauses
Q: How to handle connection failures
B. The GNU.DB Packages
GNU.DB.ESQL_Support
String related type conversion
SQL Communication Area
Exceptions
ODBC related packages
C. Porting legacy code
Migrating from Oracle to GNADE
Host variables
Query Results
Others
D. GNU Free Documentation License
0. PREAMBLE
1. APPLICABILITY AND DEFINITIONS
2. VERBATIM COPYING
3. COPYING IN QUANTITY
4. MODIFICATIONS
5. COMBINING DOCUMENTS
6. COLLECTIONS OF DOCUMENTS
7. AGGREGATION WITH INDEPENDENT WORKS
8. TRANSLATION
9. TERMINATION
10. FUTURE REVISIONS OF THIS LICENSE
E. GNU Public License (GPL) Version 2
List of Tables
4-1. Supported Platforms
6-1. Examples of embedded SQL
10-1. Exception Actions
11-1. Options
12-1. Options
27-1. Options
28-1. Options
29-1. Options
30-1. Options
List of Examples
6-1. /etc/odbc.ini entry for the test data base
9-1. Example for Embedded SQL
10-1. Embedded SQL Statements
10-2. Local SQLCA in procedures
10-3. Using DB connections as procedure arguments
10-4. Local Cursors
10-5. Accessing ODBC handles
10-6. Using dynamic SQL
10-7. Using VARCHAR
12-1. A minimal Makefile
12-2. Redirecting ESQL diagnostics
14-1. Preparing data of the ODBC driver
14-2. Connecting to the data base via ODBC
14-3. Preparing the Query via ODBC
14-4. Using host variable with ODBC
14-5. Creating the result set for a query
14-6. Fetching data of the result set via ODBC
18-1. MySQL native binding - Connecting to the database.
18-2. MySQL native binding - Executing a query
18-3. MySQL native binding - Accessing the result set
18-4. MySQL native binding - Dropping the query
A-1. Using a string in the WHERE clause
A-2. Intercpetion connection errors