Skip to content

How to increment a field by 1 when inserting a record? #1788

Closed Answered by Angelelz
riculum asked this question in Q&A
Discussion options

You must be logged in to vote

Inserting and updating are two different operations and need to be done in 2 different statements. If this is a block operation where the second step depends on the first, this should be done inside a transaction, to ensure that if any statement fails, all will fail. This is how SQL works.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@riculum
Comment options

Answer selected by riculum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants