'Declaration Public Property IdentityColumnLastValueSelect As System.String
public System.string IdentityColumnLastValueSelect {get; set;}
'Declaration Public Property IdentityColumnLastValueSelect As System.String
public System.string IdentityColumnLastValueSelect {get; set;}
This property is used in conjunction with the IdentityColumnRetrieveMode property. By default, C1DataObjects sets correct values for well-known databases such as SQL Server, MS Access, Oracle, Interbase. For example, in SQL Server 2000, this command is "SELECT SCOPE_IDENTITY()" and IdentityColumnRetrieveMode is InInsertCommand. In Microsoft Access, this command is "SELECT @@IDENTITY" and the IdentityColumnRetrieveMode is AfterInsertCommand.
In Oracle and Interbase, there are two options:
If you need a trigger setting the autoincrement key value on INSERT, use IdentityColumnRetrieveMode = AfterInsertCommand and the following properties for Oracle and Interbase:
Oracle: set IdentityColumnLastValueSelect = SELECT AUTOINCREMENTSEQUENCENAME.CURRVAL FROM DUAL and set the AutoIncrementSequenceName field property to the corresponding sequence name.
Interbase: set IdentityColumnLastValueSelect = SELECT GEN_ID(AUTOINCREMENTSEQUENCENAME, 0) FROM RDB$DATABASE and set the AutoIncrementSequenceName field property to the corresponding generator name.
Without such trigger, set the IdentityColumnRetrieveMode = BeforeInsertCommand and the following properties for Oracle and Interbase:
Oracle: set IdentityColumnLastValueSelect = SELECT AUTOINCREMENTSEQUENCENAME.NEXTVAL FROM DUAL and set the AutoIncrementSequenceName field property to the corresponding sequence name.
Interbase: set IdentityColumnLastValueSelect = SELECT GEN_ID(AUTOINCREMENTSEQUENCENAME, 1) FROM RDB$DATABASE and set the AutoIncrementSequenceName field property to the corresponding generator name.
If your database does not support this functionality, you still can implement refreshing autoincrement value in AutoIncrement = ClientAndServer writing code in AfterUpdateRow event as shown in Keys Assigned by Server or Database.
SqlDialectInfo Class
SqlDialectInfo Members
Keys Assigned by Server or Database