Toutiao -
My understanding is that INSERT sql commands do not allow you to return or query for the value of the primary key. I think that your options are to:
1) Use a manual generated primary key, such as a guid, and use this in your INSERT statements.
2) Use a stored procedure to return a new primary key value, and use this in your INSERT statements (for example, Oracle has Sequences to do this)
3) Use a SELECT statement instead of an INSERT and fetch the primary key value after you create the record. You typically need to use a keyset cursor and some databases do not support this.
4) Use stored procedures to pass all the data that needs to be written to the database and let the stored procedure do the work for you.
Scott Richardson
https://testeract.com