I'm using Oracle SQL developer, or Oracle SQL* Plus
your code END; And then use it like this: returnvalue NUMBER; procedurename(0, 'xxx', returnvalue); dbms_output. putline(returnvalue);
A stored procedure does not have a return value but can optionally take input, output, or input-output parameters.
Select (highlight) the code for creating the procedure or function, then click the Run button to create the procedure or function. Select (highlight) the code for calling the procedure or function, then click the Run button to call the procedure or function.
RETURN. RETURN is the keyword that instructs the compiler to switch the control from the subprogram to the calling statement. In subprogram RETURN simply means that the control needs to exit from the subprogram. Once the controller finds RETURN keyword in the subprogram, the code after this will be skipped.
In SQL Plus you can do this:
var x number
exec :x := myfunction();
Or you may be able to use SQL:
select myfunction() from dual;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With