PL/SQL problem with Updates that specify varchar

From: Beelzehubub <pat.kelly_at_sanchez.com>
Date: 5 Aug 2004 12:02:32 -0700
Message-ID: <df698d61.0408051102.905f683_at_posting.google.com>



Hi,

   I'm having a bit of trouble with an update performed by a PL/SQL routine that is updating more rows than it should be. Here's some of the code:

Note that ZENT.APPID is NUMBER and ZENT.UCLS is VARCHAR(12)

OPEN APPAccessCursor;
LOOP
   FETCH APPAccessCursor INTO appid,ucls;    EXIT WHEN APPAccessCursor%NOTFOUND;

   UPDATE ZENT SET "ZENT"."ACCLEVEL"='N' WHERE "ZENT"."UCLS"=ucls AND "ZENT"."APPKEY"=appid;

END LOOP;
CLOSE APPAccessCursor;

appid and ucls are populated successfully by the fetch but when the update is performed, all rows matching appid are updated and the value of ucls is essentially ignored. I've tried =, like, and in for the ucls portion of the update statement and they all produce the same result. What am I doing wrong? Received on Thu Aug 05 2004 - 21:02:32 CEST

Original text of this message