UltraLite Database User's Guide
Dynamic SQL
Structured Query Language (SQL) can be used by an application to perform a database task, such as retrieving information using a query or inserting a new row into a table. SQL is a relational database language standardized by the ANSI and ISO standards bodies. UltraLite dynamic SQL is a variant designed for use on small-footprint devices.
SQL statements are supplied as strings in function calls from the programming language you are using. UltraLite components provide functions for building and generating SQL statements. The programming interface delivers the SQL statement to the database. The database receives the statement and executes it, returning the required information (such as query results) back to the application.
Queries are one form of Data Manipulation Language used in SQL. In fact, the "Q" in "SQL" stands for query. You query, or retrieve, data from a database with a SELECT statement. A query produces a result set, which is a collection of rows that satisfy the query. The basic query operations in a relational system are projection, restriction, and join. The SELECT statement implements all of them.
A projection is a subset of the columns in a table. A restriction, also called selection, is a subset of the rows in a table, based on some conditions. For example, the following SELECT statement retrieves the names and prices of all products that cost more than $15:
SELECT name, unit_price FROM product WHERE unit_price > 15
This query uses both a projection, as shown in the SELECT clause, and a restriction, given in the WHERE clause.
You can do more with dynamic SQL than just query. It also includes statements that modify tables, the INSERT, UPDATE, and DELETE statements.
Dynamic SQL is the varant of SQL available for UltraLite components. UltraLite static interfaces use a different variant of SQL. The UltraLite components can use a table-based interface as well as dynamic SQL.
For a comparison of these data access methods, see Data access in UltraLite.