可以在PL/SQL的函数中调用过程吗? [英] can we call procedure inside a function in PL/SQL?

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

问题描述

我们可以在过程内部调用函数,但是可以在函数内部调用过程吗? 我尝试过,但是无法在函数内部调用过程. 您能告诉我为什么我们不能在函数内部调用该过程吗?

we can call the function inside the procedure , but is it possible to call procedure inside the function ? I tried but I can't call procedure inside the function. could you tell me why we can not call the procedure inside the function?

推荐答案

我尝试过,但是无法在函数内部调用过程."

" I tried but I can't call procedure inside the function."

您如何尝试?你尝试了什么?您以什么方式失败了?

How did you try? What did you try? In what way did you fail?

因为允许在函数内部调用过程.因此,如果它对您不起作用,则原因是您的代码有问题.如果您没有提供比目前更多的信息,我们将无法诊断出这一点.

Because it is permitted to call procedure inside the function. So if it isn't working for you, then the cause is something wrong in your code. We cannot possibly diagnose that without you providing a lot more information than you currently have.

两个最可能的原因是:

  1. 您的代码中存在语法错误,导致其无法编译,或其他一些错误导致运行时异常.

  1. You have a syntax error in your code which is preventing it from compiling, or some other bug which is hurling a runtime exception.

该功能可能在过程范围内,反之亦然.

The function might be in scope of the procedure but not vice versa.

您的过程正在做某些事情,当我们在查询中调用某个函数(例如发出DML)并且您在SELECT语句中调用该函数时,这是不允许的.

Your procedure is doing something which is not allowed when we call a function in a query (such as issuing DML) and you are calling your function in a SELECT statement.

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

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