|
This SQL statement can be executed in the following ways: |
Through the CA Datacom Datadictionary Interactive SQL Service Facility (interactive) |
In an application program prepared using a CA Datacom/DB SQL Preprocessor (embedded) |
By using CA Dataquery (SQL & Batch Modes) |
|---|---|---|---|
|
INSERT |
YES |
YES |
YES |
Note: YES indicates a valid execution method for this statement. To learn about using SQL keywords in CA Dataquery, see the CA Dataquery User Guide. For information about the access rights required to execute this statement, see the CA Datacom/DB Database and System Administration Guide.
The INSERT statement inserts rows into a table or view. Inserting a row into a view inserts the row into the table upon which the view is based. You must specify ISOLEVEL=C (isolation level C) in the Preprocessor options when using the INSERT statement.
Note: When the NOMAINT option of the CA Datacom/DB Utility (DBUTLTY) ACCESS function is in force, an INSERT statement receives a CA Datacom/DB return code 94(87), where 87 is a decimal internal return code (hex 57) that tells you no maintenance statements are allowed while NOMAINT is in force.
Also note that constraints that existed in versions before r10 can act differently in Release 10.0 and above because, in Release 10.0 and above, columns containing a NULL rather than a value do not cause a CHECK constraint to be violated. Constraints are considered, in Release 10.0 and above, to be satisfied unless the predicates evaluate explicitly to FALSE. That is, CHECK constraints whose predicates evaluate to UNKNOWN rather than TRUE or FALSE are considered, with Release 10.0 and above, to have been satisfied. Therefore, INSERT and UPDATE statements, from versions before r10, that resulted in constrained columns being nulled are, when used in Release 10.0 and above, successful for the first time.
Following is the syntax diagram for the INSERT statement. See Special Registers for the special-register diagram. See Subselect for the subselect's syntax diagram.
Note: The special-register is a CA Datacom/DB extension.
►►─ INSERT INTO ─┬─ table-name ─┬─┬───────────────────────────┬───────────────►
└─ view-name ──┘ │ ┌─ , ───────────┐ │
└─ ( ─▼─ column-name ─┴─ ) ─┘
┌─ , ────────────────────┐
►─┬─ VALUES( ─▼─┬─ special-register ─┬─┴─ ) ─┬───────────────────────────────►◄
│ ├─ host-variable ────┤ │
│ ├─ literal ──────────┤ │
│ └─ NULL ─────────────┘ │
└─ subselect ──────────────────────────────┘
|
Copyright © 2014 CA.
All rights reserved.
|
|