在oracle中调用存储过程的语法是什么?

时间:2022-08-21 16:40:20

Little help needed here. I'm new to Oracle and i'm not understaning the the syntax of calling a store procedure that has a single in-out parameter. Any example please?

这里需要的帮助很少。我是Oracle的新手,我并没有理解调用具有单个输入输出参数的存储过程的语法。好吗?

4 个解决方案

#1


-- procedure
CREATE OR REPLACE PROCEDURE test_proc (param IN OUT NUMBER)
IS
BEGIN
   NULL;
END;


-- call procedure
DECLARE
   var   NUMBER;
BEGIN
   test_proc (var);
END;

#2


You can use an anonymous PL/SQL block to do this:

您可以使用匿名PL / SQL块来执行此操作:

BEGIN
  do_something();
END;

#3


From the tag I assume you are asking to invoke a oracle SP from SQL plus...

从标签我假设你要求从SQL加上调用oracle SP ...

Say you have an SP with name test_me then from sql plus

假设您有一个名为test_me的SP,然后来自sql plus

SQL> execute test_me (parameters_value)

SQL> execute test_me(parameters_value)

#4


{[?=]call procedure_name[([parameter][,[parameter]]...)]}

for example

{call InsertOrder(10)}

#1


-- procedure
CREATE OR REPLACE PROCEDURE test_proc (param IN OUT NUMBER)
IS
BEGIN
   NULL;
END;


-- call procedure
DECLARE
   var   NUMBER;
BEGIN
   test_proc (var);
END;

#2


You can use an anonymous PL/SQL block to do this:

您可以使用匿名PL / SQL块来执行此操作:

BEGIN
  do_something();
END;

#3


From the tag I assume you are asking to invoke a oracle SP from SQL plus...

从标签我假设你要求从SQL加上调用oracle SP ...

Say you have an SP with name test_me then from sql plus

假设您有一个名为test_me的SP,然后来自sql plus

SQL> execute test_me (parameters_value)

SQL> execute test_me(parameters_value)

#4


{[?=]call procedure_name[([parameter][,[parameter]]...)]}

for example

{call InsertOrder(10)}