PLS-00103: Encountered the symbol "END" when expecting one of [message #630341] |
Wed, 24 December 2014 19:18  |
 |
weather3
Messages: 9 Registered: March 2014
|
Junior Member |
|
|
I am coding in SQL Developer 4.0.3.16
I am trying to comply will all of your rules. It seems some of them are here and some are there. I may have not been to every place they are posted.
I have been all over the web and have not found an answer to this. I can't compile this procedure because I get this error. Any help on getting this code compiled would enable me to continue developing this procedure. Note that I am unable to compile this code. My error is occurring before I access any data in the tables.
Thank you
ERROR: Error(87,13): PLS-00103: Encountered the symbol "END" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset The symbol ";" was substituted for "END" to continue.
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 -- ***** LINE 87 *****
END ADD_USER_GROUPS_PROC;
ERROR: Error(87,13): PLS-00103: Encountered the symbol "END" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset The symbol ";" was substituted for "END" to continue.
*BlackSwan corrected the {code} tags. read http://www.orafaq.com/forum/t/174502/ to learn how to use them correctly
[Updated on: Wed, 24 December 2014 19:32] by Moderator Report message to a moderator
|
|
|
|
|
Re: PLS-00103: Encountered the symbol "END" when expecting one of [message #630344 is a reply to message #630343] |
Wed, 24 December 2014 19:28   |
manubatham20
Messages: 566 Registered: September 2010 Location: Seattle, WA, USA
|
Senior Member |

|
|
Your PL/SQL block is not syntactically correct, below may be the one you wanted.
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 =
NULL;
END LOOP; -- outerloop; --FOR USER_INDEX IN WWTT_INPUT_CUR -- ***** LINE 87 *****
END ADD_USER_GROUPS_PROC;
But why opening 3 cursors all together, what you are doing inside LOOP?
Manu
|
|
|
|
|
|
|
|
|
|
|
Re: PLS-00103: Encountered the symbol "END" when expecting one of [message #630360 is a reply to message #630359] |
Thu, 25 December 2014 05:27  |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
PL/SQL Language Reference
Chapter 4 PL/SQL Control Statements
Section LOOP Statements
Subsection Basic LOOP Statement
Quote:The basic LOOP statement has this structure:
[ label ] LOOP
statements
END LOOP [ label ];
With each iteration of the loop, the statements run and control returns to the top of the loop.
"statements" is NOT between [], so it is a mandatory part (just like "LOOP" "END LOOP" and the semi-colon).
|
|
|