Hi Robert van Driel,
I understand that you want to retrieve the ID of the record just inserted using the Database Toolbox commands.
Unfortunately, this functionality is not yet supported by the Database Toolbox.
However, there are two workarounds for retrieving the ID/primary key of the record just inserted.
Workaround 1: You can use "@@IDENTITY" keyword to retrieve the ID of the latest inserted row, for example:
r = exec(conn,'SELECT @@IDENTITY')
r = fetch(r)
Workaround 2: Execute the query on a lower level using:
connectionHandle = conn.Handle;
queryStatement = connectionHandle.createStatement;
resultSet = queryStatement.executeQuery('INSERT INTO table_name(value1, value2,..)")
ID = resultSet.getInt(1)