Home  >  Q&A  >  body text

mysql - 存储过程在实际项目中用的多吗?

我发现很多教科书,数据库教程视频都涉及到了存储过程,但是我看过很多开源的php项目,里面几乎就没有用到存储过程啊,我看过java项目倒是有部分项目用到过存储过程,这是为什么呢?

已经从业或者开发过大型项目的程序员们你们在实际工作中用到过他吗?

还有就是存储过程里面的逻辑几乎我都可以用程序(java,php)写,为什么还要直接在数据库里面写呢?(换句话说:存储过程的意义是什么?)

ringa_leeringa_lee2741 days ago2317

reply all(12)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 16:19:58

    Let me talk about the next two points: 1. When encountering a large amount of data inserted and updated, it will be faster to use a stored procedure; 2. The program is not as convenient as the stored procedure to control the rollback operation after inserting records into a large amount of data or table, for example, at the same time When inserting into the warehousing, inventory, and outbound tables, if an error occurs in one place, the stored procedures can all be rolled back together.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 16:19:58

    Many and very important!

    reply
    0
  • Cancelreply