I am very new to PL/SQL (no I mean a real noob with it as in started learning it today) and have been trying out some simple scripts using the TOAD IDE but have become a little stuck with this one. I am simply trying to loop through a series of records using a cursor and display each one but keep getting the following error:
ORA-06550: line 13, column 3:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
The symbol ";" was substituted for "end-of-file" to continue.
My code is as follows:
SET SERVEROUTPUT ON
DECLARE
CURSOR cursor1 IS
SELECT TWOR_WORKS_ID
FROM TMA_WORKS
WHERE TWOR_ORG_REF = 9999;
BEGIN
FOR records IN cursor1
LOOP
dbms_output.put_line (records.TWOR_WORKS_ID);
END LOOP;
END
Could someone please point out where I am going wrong as I have seen a few examples and the code looks the same as what I am trying. I am guessing it is a missing ; going off the error message but where?
You just need a
;afterEND.