From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d721ab90148a4f76 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!sn-xt-sjc-05!sn-xt-sjc-01!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail From: Jason King Newsgroups: comp.lang.ada Subject: Re: EXCEPTION_WHEN_OTHERS Date: Tue, 09 Jan 2007 08:45:28 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <12q7ak54cb1bma0@corp.supernews.com> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 References: <1168349612.603238.225860@m30g2000cwm.googlegroups.com> In-Reply-To: <1168349612.603238.225860@m30g2000cwm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: g2news2.google.com comp.lang.ada:8101 Date: 2007-01-09T08:45:28-06:00 List-Id: Actually this is an Ada group not pl/sql. But since I'm a pl/sql guy I can help. If you just put a line like message('success'); after the update and before the exception you should be fine. Chris wrote: > Hi, > > Could someone please help me with regards to a problem I am having with > some PL/SQL code. > > The code is: > > if :contract.old_contract IS NOT NULL AND > :contract.new_contract IS NOT NULL THEN > BEGIN > UPDATE contracts > SET contract_no = :contract.new_contract > WHERE contract_no = :contract.old_contract; > EXCEPTION WHEN OTHERS THEN > message ('update has failed'); > END; > END IF; > > As you can see I have a message saying 'update failed' when there is an > exception i.e. when the save fails. This works fine as does the rest > of the code. > > What I need however is a way of getting a message 'save was successful' > when there are no exceptions. > > Any help would be great. > > Thanks > Chris >