Column data validation for data type, maximum length, data constraints, and other validation criteria is also not performed. %NOCHECK - Unique value checking and foreign key referential integrity checking are not performed. Specifying restriction argument(s) restricts processing as follows: If the insert request fails due to a UNIQUE KEY violation (for the field(s) of some unique key, there exists a row that already has the same value(s) as the row specified for the insert), then it automatically turns into an update request for that row, and INSERT OR UPDATE uses the specified field values to update the existing row. First it attempts to perform an insert operation. The INSERT OR UPDATE statement is a variant of the INSERT statement that performs both insert and update operations. Operational Considerations, including privileges and security, atomicity and transaction locking, referential integrity. Insert Query Results, using INSERT with a SELECT to insert multiple rows. This reference page is structured as follows:Ĭolumn and Values Arguments, including single-row INSERT value assignment syntax options and the handling of special fields, data types, special values, and default values. This use of an INSERT statement combined with a SELECT query is commonly used to populate a table with existing data extracted from other tables, as described in the “ INSERT Query Results” section below. It inserts data values for all specified columns (fields) for each row from the query result set and defaults unspecified column values to either NULL or the defined default value. It sets the %ROWCOUNT variable to the number of affected rows (always either 1 or 0).Īn INSERT with a SELECT adds multiple new rows to a table. It inserts data values for all specified columns (fields) and defaults unspecified column values to either NULL or the defined default value. The INSERT statement can be used in two ways:Ī single-row INSERT adds one new row to a table. Thus :myupdates(), :myupdates(5,), and :myupdates(1,1,) are all valid specifications.Ī SELECT query the result set of which supplies the data values for the corresponding column fields for one or multiple new rows. The lowest subscript level of the array must be unspecified. ![]() If omitted, the list of values is applied to all columns in column-number order.Ī scalar expression or comma-separated list of scalar expressions that supplies the data values for the corresponding column fields.Įmbedded SQL only - A dynamic local array of values specified as a host variable. Optional - A column name or comma-separated list of column names that correspond in sequence to the supplied list of values. An unqualified name is matched to its schema using either a schema search path (if provided) or the system-wide default schema name. ![]() A table name (or view name) can be qualified (schema.table), or unqualified (table). The name of the table or view on which to perform the insert operation. Optional - One or more of the following restriction keywords, separated by spaces: %NOLOCK, %NOCHECK, %NOINDEX, %NOTRIGGER. For further details, refer to Frozen Plans in Caché SQL Optimization Guide. ![]() The frozen plan is retained, but not used. Optional - The %NOFPLAN keyword specifies that Caché will ignore the frozen plan (if any) for this operation and generate a new query plan.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |