PL / SQL:如何执行预先形成DML并具有返回值的SP?

时间:2022-02-08 19:14:33

I have a stored procedure with the following header:

我有一个存储过程与以下标题:

FUNCTION SaveShipment (p_user_id IN INTEGER, p_transaction_id IN INTEGER, p_vehicle_code IN VARCHAR2 DEFAULT NULL, p_seals IN VARCHAR2 DEFAULT NULL) RETURN INTEGER;

And I am having trouble running it from TOAD's Editor. I cannot run it as part of a select from dual statement because it preforms DML, but if I try the following syntax which I saw recommended on some forum:

我无法从TOAD的编辑器中运行它。我不能将它作为select from dual语句的一部分运行,因为它预先形成了DML,但是如果我尝试以下语法,我在一些论坛上看到了它:

var c integer;
exec :c := orm_helper.orm_helper.SAVESHIPMENT (9999, 31896, NULL, '');
print c;

I get:

ORA-01008: not all variables bound
Details:
BEGIN :c := orm_helper.orm_helper.saveshipment (9999, 31896, null, ''); END;
Error at line 2
ORA-01008: not all variables bound

What's the proper syntax to run this sp manually?

手动运行此sp的正确语法是什么?

2 个解决方案

#1


2  

Are you calling the stored procedure from another SP?

你是从另一个SP调用存储过程吗?

I think the syntax is (if I recall correctly):

我认为语法是(如果我没记错的话):

declare
     c integer;
begin

c:=storedProc(...parameters...);

Hope this helps.

希望这可以帮助。

#2


0  

you could probably SELECT orm_helper.orm_helper.SAVESHIPMENT (9999, 31896, NULL, '') FROM DUAL.

你可以选择SELECT orm_helper.orm_helper.SAVESHIPMENT(9999,31889,NULL,'')FROM DUAL。

#1


2  

Are you calling the stored procedure from another SP?

你是从另一个SP调用存储过程吗?

I think the syntax is (if I recall correctly):

我认为语法是(如果我没记错的话):

declare
     c integer;
begin

c:=storedProc(...parameters...);

Hope this helps.

希望这可以帮助。

#2


0  

you could probably SELECT orm_helper.orm_helper.SAVESHIPMENT (9999, 31896, NULL, '') FROM DUAL.

你可以选择SELECT orm_helper.orm_helper.SAVESHIPMENT(9999,31889,NULL,'')FROM DUAL。