Reputation: 63728
This question answers about calling an Oracle stored procedure: How to execute an oracle stored procedure?
However I have a procedure which takes one IN and one OUT parameter. 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?
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;
Upvotes: 0
Views: 8986
Reputation: 167981
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?
Create a unit test.
Tools
> Unit Test
> Select Current Repository
and follow the prompts to set up a unit test repository.View
> Unit Test
to open the Unit Testing view.Create test
.Create single with dummy implementation
then click Next
.Finish
.Unit Test
view and you can right-click and select Run Test
.Oracle's documentation for unit tests is here.
Upvotes: 0
Reputation: 18410
declare
xyz MY_TABLE.EMAIL_ADDRESS%TYPE;
begin
myPackage.GetEmailForId('12345',xyz);
dbms_output.put_line(xyz);
end;
Upvotes: 3