Two different prepared statements in one single batch

前端 未结 4 755
梦毁少年i
梦毁少年i 2020-12-03 01:42

I want to send two different prepared statements in one single batch.

Currently I am doing this in two as you can see in the commented lines and it works,

4条回答
  •  眼角桃花
    2020-12-03 02:08

    You cannot execute two different statements in a single batch. As @dan mentioned you can -- and must -- do them in a single transaction.

    Another option is to use a stored procedure that can do it all in a single roundtrip to the server while maintaining the benefits of single transaction

提交回复
热议问题