version 1.5
A context is a dynamic link between 4D ODBC objects and ODBC data source objects. When a context is used to manipulate data, the operations of selecting, inserting, updating, or deleting entries on the server are performed in a manner similar to local 4D ODBC operations. The 4D ODBC interface is used to manage host data.
This chapter provides an overview of the benefits and implementation strategies of contexts. It describes the procedural flow used with context commands, and then explains how to create contexts and use them to retrieve data.
Refer to the chapters "OC Defining context" and "OC Using context" for a complete description of the context commands.
Benefits of Contexts
Although it is possible to develop 4D ODBC applications using only low-level DB-Library calls, contexts provide several advantages to developers.
Data Selection: Contexts allow you to select data from the data source without using SQL programming. Context code can actually be generated through a graphical interface.
Data Modification: After a context has been established, simple commands enable you to update, insert, and delete data source rows without using tedious SQL programming.
SQL-Compatible: Contexts can be used in conjunction with normal SQL and ODBC routines.
Multiple Contexts: Many contexts may be open simultaneously, allowing the developer great flexibility in the design of client/server applications.
4th Dimension-like Programming: Contexts provide developers with an SQL development environment that is integrated with the 4D ODBC programming environment. For this reason, experienced 4D ODBC developers will find it easier to develop applications using contexts rather than by implementing applications using Transact SQL.