Getting Pk on insert
Getting Pk on insert
I am using DevArt DataSets and i want to recover the value of the primary key when a record is inserted. In the datase there is a trigger with a sequence.
You should add the RETURNING clause to your insert statement. For this, please refer to the Using DataSet Wizard tutorial: on the 3d step select your data table and press the "Configure commands" button, navigate to the "Command Generator" tab, press the "Get Table Fields" button, in the "Refreshing" column select a checkbox against your autoincrement field and clear all other checkboxes in this column, in the Options area check "With refresh SQL" for insert command, press the "Generate Commands" button. As a result, the insert statement will include the RETURNING clause for your autoincrement field.