Not clear why this job can't be done with a straightforward Insert...Select statement, no sproc.
Errors found on a first pass, there might be more ...
DROP PROCEDURE IF EXISTS sp_Page_View_Update;
delimiter // -- MISSING DELIMITER DIRECTIVE
CREATE PROCEDURE sp_Page_View_Update() MODIFIES SQL DATA
BEGIN
DECLARE l_Cnt BIGINT DEFAULT 1;
DECLARE l_Page_ID BIGINT;
DECLARE l_Viewer_Name VARCHAR(255);
DECLARE l_View_Date DATETIME DEFAULT NOW();
DECLARE l_Done INT DEFAULT 0;
DECLARE cur1 CURSOR FOR
SELECT CONTENT.CONTENTID, user_mapping.lower_username
FROM CONTENT, user_mapping
Where CONTENTTYPE = "PAGE"AND CONTENT_STATUS = "current" AND CONTENT.LASTMODIFIER = user_mapping.user_key
Order by TITLE, VERSION DESC,CREATOR, LASTMODDATE;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET l_Done=1;
SET l_Cnt = l_Cnt + 1; -- ABOVE, DID YOU MEAN TO DEFAULT IT TO 2?
OPEN cur1;
insert_loop: LOOP
FETCH cur1 INTO l_Page_ID, l_Viewer_Name ; -- MISSING TERMINATING SEMICOLON
IF l_Done = 1 THEN
LEAVE insert_loop ; -- MISSING TERMINATING SEMICOLON
End IF ; -- MISSING TERMINATING SEMICOLON
INSERT INTO AO_1991C6_PAGE_VIEW(ID,PAGE_ID,VEIWER_ID,VIEW_DATE)
VALUES(l_Cnt,l_Page_ID,l_Viewer_Name,l_View_Date) ; -- MISSING TERMINATING SEMICOLON
SET l_Cnt = l_Cnt + 1 ; -- MISSING TERMINATING SEMICOLON
END LOOP insert_loop;
CLOSE cur1;
END;
delimiter ; -- RESTORE DEFAULT DELIMITER
call sp_Page_View_Update;