MX-Frame Library Send comments on this topic.
Statements
See Also
MX-Developer > Data Access Layer - MxAdapter > Designing Data Source > Statements

Glossary Item Box

A statement is the minimal unit of structuring in imperative programming languages. It is an entity in a MxAdapter component which is the smallest indivisible unit of execution. With statements it is possible to display and manage data. For this purpose two types of statements are introduced.

Readable Statement

A select statement returns a result set of records from one or more data sources. It is used to retrieve zero or more rows from one or more base tables, temporary tables, or views in a database. In most applications, select is the most commonly used Data Manipulation Language (DML) command. In specifying a select query, the user specifies a description of the desired result set, but they do not specify what physical operations must be executed to produce that result set. Translating the query into an optimal "query plan" is left to the system responsible for the data source (SQL database, Oracle, etc.)

Writable Statement

An insert statement adds one or more records to a data source or a database. An insert statement can only insert one row of data at a time. The insert statement does not return any rows; that is, it will not generate a result set. It can however return a single value. 

An update statement changes the data of one or more records in a data source. Either all the rows can be updated, or a subset may be chosen using a condition. The update statement does not return any rows; that is, it will not generate a result set.

A delete statement removes one or more records from a data source. A subset may be defined for deletion using a condition, otherwise all records are removed. The delete statement does not return any rows; that is, it will not generate a result set. 

For this statements to be successful, the user must have data manipulation privileges (insert,update and delete privileges) on the data source (table or column). The managed value must not conflict with all the applicable constraints (such as primary keys, unique indexes and constraints).

By default four statements are implemented

Statement Description
Select Statement for loading data from data source in order to display it in a user interface. Select statement is a readable statement.
Insert Statement for inserting new data to data source. Insert statement is a writable statement.
Update Statement for updating data in data source. Update statement is a writable statement.
Delete Statement for deleting data from data source. Delete statement is a writable statement.

Sometimes default statements are not sufficient enough for the implementation of application functionality. Because of this reason new statements can be created manually. It is possible to create Readable statement or Writable statement.

To create a new statement

  1. Open the adapter that contains data source to which a new statement will be added. 
  2. Expand the desirable data source. 
  3. Right click Statements node and select one option according to the needs of application. 
  4. A new statement is added to the end of the list of statements. Readable statements are created with the name Select. Writable statements are created with the name Update. To change the name, enter appropriate value in the Name property.

See Also

©2009 Metronik. All Rights Reserved.