Oracle 从一个过程到另一个过程的参数的变量
使用包,如何将过程中的变量赋值传递给另一个过程的参数Oracle 从一个过程到另一个过程的参数的变量,oracle,parameters,plsql,package,procedure,Oracle,Parameters,Plsql,Package,Procedure,使用包,如何将过程中的变量赋值传递给另一个过程的参数 create or replace package xyz IS procedure test IS v_temp varchar2(20); --local variable BEGIN v_temp:=20; --assigning value to a variable --if procedure is within the same package,as this example shows ,th
create or replace package xyz
IS
procedure test
IS
v_temp varchar2(20); --local variable
BEGIN
v_temp:=20; --assigning value to a variable
--if procedure is within the same package,as this example shows ,then call as below
test2(v_temp);
--if procedure is in another package say PQR then call as below,
--but the procedure should be declared in the specification of the package PQR
PQR.test2(v_temp);
--if procedure is not inside any package ,just a single procedure is there
--,then call as below
test2(v_temp);
END test ;
procedure test2(p_temp IN varchar2)
IS
BEGIN
--do you processing
END test2;
END xyz;
希望这有帮助我不确定您是否想知道全局变量或OUT参数是如何工作的。下面是使用过程的OUT参数的示例。可以找到有关使用IN和OUT的更多信息
我不明白你在问什么。您的软件包是什么样子的,您尝试过什么,遇到了什么问题?
create or replace package TEST_PKG
IS
procedure test(p_input IN NUMBER, p_output OUT NUMBER)
IS
BEGIN
p_output := p_input * p_input;
END test ;
procedure testRun
IS
v_input NUMBER := 0;
v_output NUMBER;
BEGIN
test(v_input, v_output);
DBMS_OUTPUT.PUT_LINE('OUTPUT : ' || v_output );
END test ;
END xyz;