DB version: 19c
The way v_role and v_uniqname variables were assinged values in Line 6 is a valid. Right ? It seems to work.
But, I just wanted to make sure there are no pitfalls in this approach.
create or replace procedure testy
as
v_role varchar2(35) ;
v_uniqname varchar2(64);
begin
select database_role, db_unique_name into v_role, v_uniqname from v$database ; ## Line 6
dbms_output.put_line(v_role);
dbms_output.put_line(v_uniqname);
end;
/
Executing the stored proc
SQL> set serveroutput on
SQL> exec testy;
PRIMARY
CDB_17P
PL/SQL procedure successfully completed.