create or replace procedure pr
is
v_date date;
begin
select sysdate into v_date from dual;
DBMS_output.put_line(v_date);
end pr;
Procedure cannot be executed using select statement, you can use function if you would want to execute using select statement.
If you would want to execute procedure using select statement then one approach is wrap your procedure with a function and call function using select statement.
CREATE OR REPLACE PROCEDURE pr (o_param OUT DATE)
IS
v_date DATE;
BEGIN
SELECT SYSDATE
INTO v_date
FROM DUAL;
o_param := v_date;
END pr;
Now wrap the procedure with a function
CREATE OR REPLACE FUNCTION my_funct
RETURN DATE
AS
o_param DATE;
BEGIN
pr (o_param);
RETURN o_param;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
DBMS_OUTPUT.put_line (
DBMS_UTILITY.format_error_backtrace || ' ' || SQLERRM
);
-- raise exception
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (
DBMS_UTILITY.format_error_backtrace || ' ' || SQLERRM
);
-- raise exception
END my_funct;
/
And call the function using select statement
SELECT my_funct FROM DUAL