This code below is properly formatted. I will post again. CREATE OR REPLACE PROCEDURE ADD_USER_GROUPS_PROC AS
V_ ACTIVE_FLAG := WWTT_INPUT.ACTIVE_FLAG%TYPE;
V_ BEGIN_DATE := WWTT_INPUT.BEGIN_DATE%TYPE;
V_ END_DATE := WWTT_INPUT.END_DATE%TYPE;
V_ GROUP_NAME := WWTT_INPUT.GROUP_NAME%TYPE;
V_ USER_ID := WWTT_INPUT.USER_ID%TYPE;
V_ USER_TYPE := WWTT_INPUT.USER_TYPE%TYPE;
V_ ACCESS_LEVEL := WWTT_INPUT.ACCESS_LEVEL%TYPE;
V_ COUNTRY := WWTT_INPUT.COUNTRY%TYPE;
V_ FIRST_NAME := WWTT_INPUT.FIRST_NAME%TYPE;
V_ GEOGRAPHY := WWTT_INPUT.GEOGRAPHY%TYPE;
V_ LAST_NAME := WWTT_INPUT.LAST_NAME%TYPE;
V_ USER_EMAIL := WWTT_INPUT.USER_EMAIL%TYPE;
USER_INDEX NUMBER;
CURSOR WWTT_INPUT_CUR IS
SELECT * FROM SYSTEM.WWTT_INPUT
WHERE USER_ID LIKE 'A%';
CURSOR WWTT_USERS_CUR IS
SELECT * FROM SYSTEM.WWTT_USERS;
CURSOR WWTT_GROUPS_CUR IS
SELECT * FROM SYSTEM.WWTT_GROUPS;
BEGIN
-- SELECT USER_ID INTO V_ASDF FROM WEATHER.WWTT_USER_GROUPS WHERE USER_id <> ' ';
-- DBMS_OUTPUT.PUT_LINE('V_ASDF: ' || V_ASDF);
OPEN WWTT_INPUT_CUR;
OPEN WWTT_USERS_CUR;
OPEN WWTT_GROUPS_CUR;
FETCH WWTT_INPUT_CUR INTO V_WWTT_INPUT;
FETCH WWTT_USERS_CUR INTO V_WWTT_USERS;
FETCH WWTT_GROUPS_CUR INTO V_WWTT_GROUPS;
INSERT INTO SYSTEM.WWTT_GROUPS
(GROUP_NAME,BEGIN_DATE,ACTIVE_FLAG,END_DATE)
VALUES
(V_WWTT_INPUT.GROUP_NAME,SYSDATE,'Y',NULL);
--<<outerloop>>
FOR USER_INDEX IN WWTT_INPUT_CUR LOOP
--IF WWTT_USERS_CUR.USER_ID =
END LOOP; -- outerloop; --FOR USER_INDEX IN WWTT_INPUT_CUR
END ADD_USER_GROUPS_PROC;