why wont this work ? PL\sql question

From: cookie <newsreply_at_cookiesoftware.nl>
Date: Sun, 16 Dec 2001 19:29:14 +0100
Message-ID: <9vip7a$jgv$1_at_reader05.wxs.nl>


hi everbody

I'm quit new to oracle and i am trying to write some pl/sql code. I have writeen this code and what i try to do is this i have a table called "APP DATA" wich holds a number. I return this number and put the number + 1
back into the table.

FoundNr INTEGER;
BEGIN
   FoundNr := 0;
   SELECT Data Value INTO foundnr

      FROM Cookie.App Data
      WHERE Data Type = 1;

IF FoundNr > 0 THEN

    UPDATE cookie.app data
    SET data value = 33
    WHERE data type = 1;
    RETURN FoundNr;
ELSE
    RETURN 0;
END IF;
EXCEPTION
WHERE OTHERS THEN
   RETURN 0; Every thing goes ok accept the update statement. I causes a jump to the exceptions and a return of 0. Running the same update (update app data set data value = 33 where data type = 1;) in sql plus work just fine !!! What am i doing wrong here ?

Cheers,

Robert

--
Received on Sun Dec 16 2001 - 19:29:14 CET

Original text of this message