3 ms·
> You know ahead of time how many items you're trying to insert, it would be completely pointless to return that. I often use "insert into mytable(...) select
by magicalhippo 6y ago
> You know ahead of time how many items you're trying to insert, it would be completely pointless to return that.
I often use "insert into mytable(...) select ... from ... where ...", and I know I only want one row inserted.
In such cases checking that exactly one row was inserted is a very nice safeguard against buggy code/query, or in the freak case someone messed with the DB.