Are there downsides to using prepared statements?

后端 未结 5 708
陌清茗
陌清茗 2020-12-17 17:06

I\'ve been reading a lot about prepared statements and in everything I\'ve read, no one talks about the downsides of using them. Therefore, I\'m wondering if there are any \

5条回答
  •  一整个雨季
    2020-12-17 17:14

    There is one other small issue with prepared statements vs dynamic sql, and that is that it can be harder to debug them. With dynamic sql, you can always just write out a problem query to a log file and run it directly on the server exactly as your program sees it. With prepared statements it can take a little more work to test your query with a specific set of parameters determined from crash data. But not that much more, and the extra security definitely justifies the cost.

提交回复
热议问题