Chapter 6: Working with Dynamic SQL
This chapter describes how to use API dynamic SQL (DSQL) functions to handle dynamically created SQL statements for data definition and manipulation. Using low-level API calls enables client applications to build SQL statements or solicit them from end users at runtime, providing end users with a familiar database interface. It also provides applications developers low-level access to InterBase features, such as multiple databases, not normally available at a higher level with embedded DSQL statements. For example, the InterBase isql utility is a DSQL application built on low-level API calls.
All API DSQL function names begin with “isc_dsql” to make it easier to distinguish them from other API calls. This chapter covers the following topics:
- Overview of the DSQL Programming Process
- DSQL API Limitations
- Writing an API Application to Process SQL Statements
- Understanding the XSQLDA
- DSQL Programming Methods
- Determining an Unknown Statement Type at Runtime
Overview of the DSQL Programming Process
Building and executing DSQL applications with the API involve the following general steps:
- Embedding DSQL API functions in an application.
- Using host-language facilities, such as datatypes and macros, to provide input and output areas for passing statements and parameters at runtime.
- Programming methods that use these statements and facilities to process SQL statements at runtime.
These steps are described in detail throughout this chapter.