[英]How to execute a stored procedure which has an output parameter
This question answers about calling an Oracle stored procedure: How to execute an oracle stored procedure? 这个问题回答有关调用Oracle存储过程的问题: 如何执行Oracle存储过程?
However I have a procedure which takes one IN and one OUT parameter. 但是我有一个过程,需要一个IN和一个OUT参数。 What should my test syntax in Oracle SQL Developer look like to define a variable, run a stored procedure, and output the result of that variable?
我在Oracle SQL Developer中的测试语法应该如何定义变量,运行存储过程并输出该变量的结果?
I'm trying this but declaring the variable gives me an error: 我正在尝试这样做,但是声明变量给我一个错误:
begin
xyz MY_TABLE.EMAIL_ADDRESS%TYPE := NULL;
myPackage.GetEmailForId('12345',xyz);
end;
declare
xyz MY_TABLE.EMAIL_ADDRESS%TYPE;
begin
myPackage.GetEmailForId('12345',xyz);
dbms_output.put_line(xyz);
end;
What should my test syntax in Oracle SQL Developer look like to define a variable, run a stored procedure, and output the result of that variable?
我在Oracle SQL Developer中的测试语法应该如何定义变量,运行存储过程并输出该变量的结果?
Create a unit test. 创建一个单元测试。
Tools
> Unit Test
> Select Current Repository
and follow the prompts to set up a unit test repository. Tools
> Unit Test
> Select Current Repository
然后按照提示设置单元测试存储库。 View
> Unit Test
to open the Unit Testing view. View
> Unit Test
以打开“单元测试”视图。 Create test
. Create test
。 Create single with dummy implementation
then click Next
. Create single with dummy implementation
然后单击Next
。 Finish
. Finish
。 Unit Test
view and you can right-click and select Run Test
. Unit Test
视图中,您可以右键单击并选择Run Test
。 Oracle's documentation for unit tests is here . Oracle的单元测试文档在这里 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.