comp.lang.ada
 help / color / mirror / Atom feed
From: Jason King <jhking@airmail.net>
Subject: Re: EXCEPTION_WHEN_OTHERS
Date: Tue, 09 Jan 2007 08:45:28 -0600
Date: 2007-01-09T08:45:28-06:00	[thread overview]
Message-ID: <12q7ak54cb1bma0@corp.supernews.com> (raw)
In-Reply-To: <1168349612.603238.225860@m30g2000cwm.googlegroups.com>

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
> 



  reply	other threads:[~2007-01-09 14:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 13:33 EXCEPTION_WHEN_OTHERS Chris
2007-01-09 14:45 ` Jason King [this message]
2007-01-10 10:41 ` EXCEPTION_WHEN_OTHERS Alex R. Mosteo
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox