我执行Oracle Apex中的过程怎么办?

huangapple go评论56阅读模式
英文:

How do I execute the procedure in Oracle Apex

问题

I created the simplest procedure in Oracle Apex, but it failed when I used the exec statement to execute.
How can I execute the procedure in Oracle Apex?

This is my procedure.

create or replace PROCEDURE hello_world
AS
BEGIN
dbms_output.put_line('Hello World!');
END;
/

I found in other StackOverflow workarounds, I can call it like this in the Apex > SQL Workshop > SQL Commands:

BEGIN

hello_world;

END;

But I want to call it like exec hello_world statement in Oracle Apex to get the result, is there a way? What menu or screen should I execute?

英文:

I created the simplest procedure in Oracle Apex, but it failed when I used the exec statement to execute.
How can I execute the procedure in Oracle Apex ?

This is my procedure.

create or replace PROCEDURE hello_world
AS
BEGIN
   dbms_output.put_line('Hello World!');
END;
/

I found in other StackOverflow workarounds, I can call it like this in the Apex > SQL Workshop > SQL Commands:

BEGIN

 hello_world;

 END;

But I want to call it like exec hello_world statement in Oracle Apex to get the result, is there a way? What menu or screen should I execute?

答案1

得分: 1

exec(实际上是缩写的execute)(文档)是一个SQL*Plus命令。

exec 嵌入 PL/SQL 语句到 begin-end 块中,以便执行。

它在一些其他环境中也可以工作,如 Oracle SQL Developer 或 TOAD,但它在 Oracle Application Express(Apex)中不起作用

因此,对于你的问题

我想在 Oracle Apex 中像 exec hello_world 语句一样调用它来获取结果,有办法吗?

答案是没有

英文:

exec (which is, actually, abbreviated execute) (<a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqpug/EXECUTE.html#GUID-A64F29C8-B5C7-426D-82E9-A8E85763F3D6">documentation</a>) is a SQL*Plus command.

exec embeds PL/SQL statement into begin-end block so that it could be executed.

It works in some other environments as well, such as Oracle SQL Developer or TOAD, but it does not work in Oracle Application Express (Apex).

Therefore, the answer to your

> I want to call it like exec hello_world statement in Oracle Apex to get the result, is there a way?

is no.

huangapple
  • 本文由 发表于 2023年5月7日 08:19:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76191737.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定