ECN-GL570 IDENTITY column support for Acu4GL for SQL Server

Product: Acu4GL

Module: MSSQL

Machines Affected: All

Known Versions Affected: All

DESCRIPTION:

Acu4GL for Microsoft SQL Server now supports tables that contain identity columns.

Acu4GL can use the IDENTITY-COLUMN XFD directive to create an identity column in a new or existing table, or it can handle tables with existing identity columns. (See ECN-4603 for more details on the new IDENTITY-COLUMN XFD directive.)

When reading a row with READ, READ NEXT, or READ PREVIOUS, the field specified by the IDENTITY-COLUMN is filled in with the value in the row.

When writing a row with WRITE, the field specified by the IDENTITY-COLUMN is ignored, allowing the server to fill in the value.

Note: The record is not changed by the WRITE statement, but the value of the column in the database is set by the server.

When updating a row with REWRITE, the field specified by the IDENTITY-COLUMN will be used as the WHERE clause of the UPDATE statement. Similarly, when deleting a row with DELETE, the field specified by the IDENTITY-COLUMN will be used as the WHERE clause of the DELETE statement.

In both cases, the desired row must be identified by the COBOL program setting the field specified by the IDENTITY-COLUMN correctly. Otherwise, an error 23 could be returned, or the wrong row updated or deleted.

Note: SQL Server does not guarantee the uniqueness of values with the IDENTITY property, and so the interface, when creating a table, will also create a constraint to ensure uniqueness of the column.

Because there can only be one IDENTITY column in a table, the interface will not add an internally-used IDENTITY column to the table if there is a column already identified as the IDENTITY-COLUMN.