Using Embedded SQL
The Structured Query Language (SQL) is the de facto standard for manipulating and defining data in most relational database systems. Originally defined by IBM research in 1974, numerous database vendors have since implemented it.
SQL is a set-oriented language based on relational algebra. Every SQL statement uses one or more sets and produces one or more result sets. The set-oriented approach is quite different from the traditional record-oriented programming approach. In SQL, you define what you want rather than how you want it done.
The Embedded SQL implementation in DataFlex allows you to issue SQL statements from within a DataFlex program. The SQL statements can be specified by sending messages to SQL broker objects.
Embedded SQL is supported by the following DataFlex SQL Drivers:
The Embedded SQL interface for all three environments is the same, enabling an easy switch from one environment to another. A DataFlex program using Embedded SQL on DB2 can also be used on SQL Server, provided the underlying tables are present in both environments and no environment-specific syntax has been used. We will indicate server-specific issues where appropriate.
This guide starts with a short introduction to SQL. This introduction is not exhaustive; there are many good books on SQL programming available from beginner to expert level. If you want to know more about SQL, we suggest you look for such books.
You must also understand the classes that define the SQL broker objects. These are the base SQL handling objects that manage all SQL activity in a DataFlex program.