Previous Topic: Modifying Data Using CA DataqueryNext Topic: DQL Language Examples


DQL Language Data Modification

A brief description of each DQL Mode data manipulation command follows:

ERASE

Allows you to remove rows from the database. Include selection criteria in the form of a WITH statement contained in a FIND statement of a query. This criteria qualifies the selection to help ensure that you delete the proper row or rows from the database. Use qualification to alleviate the possibility of deleting the wrong rows.

INSERT

Adds rows to the database. The row name you specify in the INSERT statement must be defined to CA Datacom Datadictionary. An INSERT statement includes one set clause for each column for which you are designating a value. If you do not specify a value for a column contained in the specified row, CA Dataquery provides a default value when you add the row, unless the column is defined as a repeating field. Character columns default to blanks and numeric columns default to zeros.

Note: Include a SET clause to specify the values for the columns in the Master Key for that row.

UPDATE

Replaces the value of one or more columns within a row already in the database with another value. Use selection criteria in the form of a WITH statement used in a FIND statement of a query. This criteria qualifies the rows you want to modify. Use qualification to alleviate the possibility of modifying the wrong rows.

The UPDATE statement requires one SET clause for each column you want to modify within the row. CA Dataquery only modifies the columns named in the SET clauses.

Your Tasks

Your company may ask you to create queries that perform one or more of these functions or to modify an existing query so that the new version performs one of these functions. In either case, verify that the user or group of users who plan to execute these queries are authorized to perform these functions. Any user who executes a query that performs a FIND, UPDATE, INSERT, or ERASE against a table must be authorized for that function by the administrator who has SECURITY CONTROL authorization. (If CA Dataquery is externally secured, any user must be authorized through external security to perform any data maintenance functions on a table.) This is one of CA Dataquery's security features that allows your site to maintain control over the integrity of your data.

The format of UPDATE, INSERT, and ERASE are identical to the format of FIND as documented in the CA Dataquery end-user documentation with the exception of the SET statement. In a FIND, the SET statement creates a new column but in the UPDATE or INSERT, the column named in the SET statement must be the name of a column in a table. The following examples of these functions are based on the Sample Order Entry Database.