Re: How to execute a SP at Forms and commit its changes

From: DA Morgan <damorgan_at_exxesolutions.com>
Date: Sat, 15 Mar 2003 09:33:54 -0800
Message-ID: <3E736402.ED5ED459_at_exxesolutions.com>


ariadnedbka wrote:

> I will try to explain better.
>
> I have to insert a record in a table, let's say TABLE1.
>
> After the record is insert sucessfully at the database (same for update
> and delete), I have to call a stored procedure (let's say SP1) that will
> update other tables based on the values just inserted at TABLE1.
>
> The procedure SP1 returns an error code to the forms.
> If SP1 returns without any error, I have to COMMIT its changes.
> If SP1 returns with error, I have to ROLLBACK.
> But in any case I cannot touch the changes made at TABLE1 before running
> the stored procedure.
>
> Hope this is better :-)
>
> Thanks for your help
> Ariadne
>
> --
> Posted via http://dbforums.com

Then I would suggest an AFTER-INSERT OR UPDATE OR DELETE trigger on the table. All activity is a single transaction, as it should be, and the problem disappears. Just make sure that when the trigger calls the second procedure ... that procedure does not contain any commits or rollbacks ... in fact it sounds more like something for a function returning a Boolean, True/False, than something for a procedure.

Daniel Morgan Received on Sat Mar 15 2003 - 18:33:54 CET

Original text of this message