Identity Constraints
The DB Access Module for ODBC uses the SQL 2003 standard syntax for identity columns when creating tables, which supports all attributes set on an
RWDBIdentityConstraint object.
When fetching an identity column, the module queries the
SQL_DESC_AUTO_UNIQUE_VALUE attribute of the column to determine if the column is an identity column. It cannot fetch any identity attributes, hence an identity column will have a valid
RWDBIdentityConstraint object but with no attributes.
You can set an identity column’s attributes by attaching an
RWDBIdentityConstraint object containing those attributes to the
RWDBColumn when you create a table. SourcePro DB will include in the generated SQL any attributes that are set.
If the database doesn’t support the SQL standard syntax, instead use RWDBConnection::executeSql() to create the table with the syntax supported by the underlying database.
If the database doesn’t support all the identity attributes, any SQL containing those attributes might fail, so avoid setting unsupported attributes on the
RWDBIdentityConstraint object. SourcePro DB creates SQL containing only those attributes explicitly set on
RWDBIdentityConstraint.