是否可以在用户定义的函数中调用存储过程? [英] Is it possible to call a stored procedure in a user defined function ?

查看:51
本文介绍了是否可以在用户定义的函数中调用存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在sql server,mysql或oracle中的用户定义函数中调用存储过程?

Is it possible to call a stored procedure in a user defined function in sql server, mysql or oracle ?

推荐答案

您可以作弊并通常,您希望函数具有确定性-即,在给定相同数据集的情况下,它始终会返回相同的结果.请参阅此有关确定性和非确定性功能的Microsoft文章,以了解限制.

Normally, you want your function to be deterministic - i.e. given the same dataset it always returns the same results. See this Microsoft article on deterministic and non-deterministic functions to understand the restrictions.

这取决于您要处理的内容.您很可能希望在函数内部执行某些本不应该尝试执行的操作,因为您来自程序或非基于集合的编程背景.

It depends on what you want to do with it. There's a healthy chance you want to do something inside your function that you shouldn't be trying to do, because you've come from a procedural or non-set-based programming background.

这篇关于是否可以在用户定义的函数中调用存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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