As the title says, is it possible to return nothing from a PL/SQL function?
My function is as follows, and I am getting errors when I leave out the return:
create or replace
FUNCTION DeleteAttributes
(code IN varchar2)
CURSOR c_attributes = SELECT ...
BEGIN
FOR attribute_record IN c_attributes
LOOP
...
END LOOP;
END;
Oracle PL/SQL functions must have a return. If you declare your subprogram as a procedure, then it won't give you errors when it is lacking a return (procedures can't have a return).
create or replace
PROCEDURE DeleteAttributes
(code IN varchar2)
CURSOR c_attributes = SELECT ...
BEGIN
FOR attribute_record IN c_attributes
LOOP
...
END LOOP;
END;
By definition, a function returns a value, so you must have a RETURN statement. Have a look at the syntax definition for a function in the Oracle documentation. RETURN is not an option.
I'm not even sure why you would want to do this.
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