create or replace procedure vars_info
is
	obj_type varchar(100);
begin
	DBMS_OUTPUT.enable;
	DBMS_OUTPUT.PUT_LINE('Имя схемы: s174692');

	dbms_output.put_line('No.   Имя Пакета   Тип объекта   Имя объекта');
	dbms_output.put_line('____  ____________ ____________  ___________');

	for row in (select rownum, object_name, type, name from user_identifiers where object_type in ('PACKAGE', 'PACKAGE BODY') and usage='DECLARATION' and type in ('VARIABLE', 'CONSTANT') and usage_context_id in (select usage_id from user_identifiers where type='PACKAGE'))
	loop
		if row.type = 'VARIABLE' then
			obj_type := 'Переменная';
		end if;

		if row.type = 'CONSTANT' then 
			obj_type := 'Константа';
		end if; 

		dbms_output.put_line(RPAD(row.rownum, 4) || ' ' || RPAD(row.object_name, 12) || ' ' || RPAD(obj_type, 12) || ' ' || RPAD(row.name, 30));
	end loop;
end vars_info;
/
