可以从sql plus运行oracle包而不将其编译到数据库中吗?

发布于 2024-09-30 19:16:48 字数 102 浏览 1 评论 0原文

我有一个特定的oracle包文件(pbk和pks)。我想执行 sqlplus 包中的方法之一。我想这样做而不将包编译到 oracle 数据库中。

这可能吗?如果是这样怎么办?

I have a certain oracle package file (pbk with pks). I want to execute one of the methods in the package from sqlplus. I want to do so without compiling the package into the oracle database.

Is this possible ? if so how ?

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

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

发布评论

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

评论(1

没︽人懂的悲伤 2024-10-07 19:16:48

您可以使用匿名 PLSQL 块来运行某些内容而无需编译到数据库,但不编译到数据库的对象数据库中存在的内容(包、函数、存储过程、类型等)需要在 PLSQL 匿名块内声明。

这意味着您必须从包/等中复制要测试的方法,并将它们粘贴到 PLSQL 块中:

DECLARE

  FUNCTION your_fnc() RETURN ... AS ...

BEGIN

  SELECT your_fnc()
    FROM DUAL;

END;

You can use an anonymous PLSQL block to run something without compiling to the database, but objects that don't exist in the database (package, function, stored procedure, type, etc) need to be declared within the PLSQL anonymous block.

That means you'll have to copy the method(s) you want to test from the package/etc, pasting them within the PLSQL block:

DECLARE

  FUNCTION your_fnc() RETURN ... AS ...

BEGIN

  SELECT your_fnc()
    FROM DUAL;

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