Writing a DSQL Application

From InterBase
Jump to: navigation, search

Go Up to Using Dynamic SQL


Write a DSQL application when any of the following are not known until run time:

  • The text of the SQL statement
  • The number of host variables
  • The data types of host variables
  • References to database objects

Writing a DSQL application is usually more complex than programming with regular SQL because for most DSQL operations, the application needs explicitly to allocate and process an extended SQL descriptor area (XSQLDA) data structure to pass data to and from the database.

To use DSQL to process a SQL statement, follow these basic steps:

  1. Determine if DSQL can process the SQL statement.
  2. Represent the SQL statement as a character string in the application.
  3. If necessary, allocate one or more XSQLDA for input parameters and return values.
  4. Use an appropriate DSQL programming method to process the SQL statement.

Topics

Advance To: