Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> sql question/procedure

sql question/procedure

From: Erica <erica_johnson_at_hotmail.com>
Date: 21 Mar 2002 13:52:23 -0800
Message-ID: <f0d5a4f9.0203211352.2872f34d@posting.google.com>


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
    DELETE from antagen;
    DELETE from reserv;
    DELETE from ej_vald;

        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;

end;
/ Received on Thu Mar 21 2002 - 15:52:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US