Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> sql question/procedure
Hi,
I am trying to do some self education and I am pretty much stuck. TOAD is complaining about that the DECLARE is not correct and I am curious if someone out there can spot where I have missed out on some syntax. I am lost.
Thanks, I appreciate it!
Erica
CREATE OR REPLACE PROCEDURE test (P_FYLLD IN NUMBER, P_KURS OUT
VARCHAR2)
IS
STUDENTID NUMBER;
VAL VARCHAR2;
P_FYLLD BOOLEAN;
DECLARE
CURSOR stud_cursor IS
select studentid, val1, val2, val3, total from student; stud_rec stud_cursor%ROWTYPE;BEGIN
OPEN stud_cursor;
<<first_loop>>
FOR i in 1..50
LOOP FETCH stud_cursor INTO stud_rec; EXIT WHEN stud_cursor%NOTFOUND; IF KURS_FYLLD(stud_rec.val1) = TRUE THEN INSERT INTO ANTAGEN values (studentid, VAL1); ELSE INSERT INTO RESERV values (studentid, val1); DBMS_OUTPUT.put_line('i = '||i); GOTO first_loop; END LOOP;