Skip to content

Get_RID_After_Create

Should the value of the record identity column be fetched after creating a new record?

Supported By

  • SQL Drivers (SQL Server, DB2, and ODBC)

Value

  • YES
  • NO

Associated Attribute

Remarks

When this keyword is set to YES, after records are created in a table, the assigned record identity is moved to the record buffer used by DataFlex. Setting this keyword to NO will switch off moving the new identity to the record buffer. This eliminates a Client/Server communication round trip, thus speeding up performance when creating records.

For the DataFlex SQL Server Driver, the way the record identity is moved to the buffer depends on the setting of the GENERATE_RECORD_ID_METHOD keyword. If that keyword is set to Identity_Column, the Ident_Current function of SQL Server will be used (i.e., @@IDENTITY in pre-SQL Server 2000 versions).

For the DataFlex DB2 Driver, the way the record identity is moved to the buffer also depends on the setting of the GENERATE_RECORD_ID_METHOD keyword. If that keyword is set to Identity_Column, the IDENTITY_VAL_LOCAL function of DB2 will be used. When the GENERATE_RECORD_ID_METHOD keyword is set to Dispenser_Table, the record identity value will be selected from the dispenser table.

For all SQL Drivers, the way the record identity is moved to the buffer when the GENERATE_RECORD_ID_METHOD keyword is set to None or External is the same; the maximum value of the record identity column is used.

Be aware that setting this keyword to NO can result in unwanted or erroneous behavior. Switching off the move behavior can speed up bulk creation of records. This keyword will rarely be used; normally, you will only use this attribute from within the program logic where it will be used in massive record creations. In such cases, it will be switched off, and then the records are created after which the attribute is switched back ON.

See Also