【问题标题】:How many ways execute Stored procedure will be executing执行存储过程的方式有多少种
【发布时间】:2013-11-28 09:05:29
【问题描述】:

程序:

CREATE OR REPLACE PROCEDURE DOUBLEN (N IN OUT number) IS
BEGIN
    N := N * 2;
END;  

为了上面的程序执行目的,我写了跟随 pl/sql 代码

DECLARE
    R INT;
BEGIN
    R := 7;
    DBMS_OUTPUT.PUT_LINE('BEFORE CALL R IS: ' || R);
    DOUBLEN(R);
    DBMS_OUTPUT.PUT_LINE('AFTER CALL R IS: ' || R);
END;

我的问题是有什么方法可以执行我的程序。请告诉我

【问题讨论】:

  • 您的问题到底是什么?它对我来说工作正常吗?
  • @Armuni 还有其他方法可以执行我的存储过程。
  • 我不确定你想知道什么?为什么需要另一种执行过程的方式?
  • 因为如果这个过程适用于小型存储过程。如果您编写大型存储过程,执行至关重要。所以我正在寻找另一种方式
  • 这取决于你想要实现什么,你如何重写你的查询。请编辑您的问题并明确您想要实现的目标。如果你只是想知道如何使一些随机程序更好,那么没有答案,这个问题应该被关闭。

标签: sql oracle stored-procedures plsql


【解决方案1】:

程序:

create or replace procedure proc_in_out
 (n in out number)
 as 
 begin
 dbms_output.put_line('value of n before manipulation'||' '||n);
 n:=n*2;
 dbms_output.put_line('value of n after manipulation'||' '||n);
end proc_in_out;

  set serveroutput on;
     declare 
      n number;
      begin
      n:=2;
      proc_in_out(n);
    end;

    anonymous block completed
    value of n before manipulation 2
    value of n after manipulation 4

试试这个就行了……

【讨论】:

  • 匿名块执行完毕,但没有出来
  • 不确定如何回答问题,因为问题中的代码工作正常。
猜你喜欢
  • 1970-01-01
  • 2019-07-29
  • 1970-01-01
  • 2013-06-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多