存储过程和触发器之间的SQL差异 [英] SQL Differences between stored procedure and triggers

查看:66
本文介绍了存储过程和触发器之间的SQL差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解存储过程和sql中的触发器之间的区别。
如果有人可以对我解释一下,那就太好了。

I'm having trouble understanding the difference between a stored procedure and a trigger in sql. If someone could be kind enough to explain it to me that would be great.

预先感谢

推荐答案

存储过程是用本地版本的PL / SQL编写的用户定义的代码段,它可能返回通过调用它而调用的值(使其成为函数)。

A stored procedure is a user defined piece of code written in the local version of PL/SQL, which may return a value (making it a function) that is invoked by calling it explicitly.

触发器是一个存储过程,在发生各种事件(例如更新,插入,删除)时会自动运行。

A trigger is a stored procedure that runs automatically when various events happen (eg update, insert, delete).

IMHO存储过程是除非绝对需要,否则应避免使用

IMHO stored procedures are to be avoided unless absolutely required.

这篇关于存储过程和触发器之间的SQL差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆