To fix the compile error then just remove the DECLARE
statement in the second line.
However, you can dramatically simplify the code:
CREATE OR REPLACE PROCEDURE get_degree(ver CHAR)
AS
TYPE vertex_data IS RECORD
(
ver_name Vertices.Ver_Name%TYPE,
degree Vertices.Degree%TYPE
);
TYPE vertex_data_table IS TABLE OF vertex_data;
vdt vertex_data_table;
BEGIN
SELECT ver_name,degree
BULK COLLECT INTO vdt
FROM vertices v
WHERE ver_name <> ver
AND EXISTS ( SELECT 'X'
FROM Edges e
WHERE ( e.Vertex1 = ver AND e.Vertex2 = v.Ver_Name )
OR ( e.Vertex2 = ver AND e.Vertex1 = v.Ver_Name )
);
FOR i IN 1..vdt.COUNT LOOP
dbms_output.put_line(vdt(i).ver_name||'='||vdt(i).degree);
END LOOP;
END get_degree;
/
(Assuming you don't have looping edges in the graph or aren't interested in returning the degree of the input vertex).