如何定义自己在使对象可用于这些函数的功能时必须使用功能(在规格末尾使用我的对象)?

发布于 2025-02-13 18:47:52 字数 476 浏览 0 评论 0原文

在此问题,我已经提供了示例包/对象:

  • 实现一些功能。
  • 仅通过使这些功能可用来定义其他功能。这意味着。我不编写功能主体,而只能使用“使用package_name”或“使用package_body”的规格。

我想,使用我的pakcage/对象实现另一个功能的方法是在某个地方定义的。

我想知道是否有办法定义自己如何使用软件包/对象。我想要一种无需每次编写身体而无需编写身体的方法,而只能在规格中写出该功能使用我的软件包。

我所要求的类似于Java接口或C#中的扩展方法中已经实现的功能。

PS:我认为标题不太明确。如果有人提出另一个标题,我会很高兴。

In this question, I've given examples of package/object that :

  • implement some functions.
  • are used to define other functions by only making them availaible to those functions. It means. I don't write a function body but only a spec with "using package_name" or "using package_body" in the end.

I suppose that the way to use my pakcage/object to implement another function is defined somewhere.

I would like to know if there a way to define myself how to use a package/object. I want a way to implement a functions without writing the body everytime but only by writing in the spec that the function is using my package.

What I'm asking for is similar to already implemented function in a interface in java or an extention method in c#.

P.S. : I don't think that title is very clear. I would be glad if someone would propose another title.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2025-02-20 18:47:52

我想要一种无需每次编写身体而在不编写身体的情况下实现功能的方法

您无法定义一个函数/过程,该功能/过程引用SQL存储的函数/过程。如果您声明功能或过程,则必须包括签名和身体。

来自

create_function :: =

plsql_function_source :: =

src = “ 代码>身体是必需的。

对于呼叫规范,您可以引用一个函数,但它将是外部Java方法或C函数,而不是 SQL中定义的另一个函数。

I want a way to implement a functions without writing the body everytime but only by writing in the spec that the function is using my package.

You cannot define a function/procedure that references an SQL stored function/procedure like that. If you declare a function or procedure then it must include the signature and the body.

From the documentation:

create_function::=

Create function syntax diagram

plsql_function_source ::=

PL/SQL function source syntax

For a standalone function the body is required.

For a call specification, you can reference a function but it will be an external Java method or a C function and NOT another function defined in SQL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文