Re: FRM-40654 in Forms 4.5

From: Steve Cosner <stevec_at_zimmer.CSUFresno.EDU>
Date: 1996/10/01
Message-ID: <52risj$cvf_at_zimmer.CSUFresno.EDU>#1/1


In article <01bbaf16$636f4b00$22f719ce_at_rickfor.scsn.net>, rick forrest <rickfor_at_scsn.net> wrote:
>I have a form that calls a stored procedure to do some last minute
>validation, i.e. just before POST-DATABASE-COMMIT. The stored proc
>updates the database directly. Consequently, I get the message
>FRM-40654. Record has been updated by another user, requery to see
>changes.
>
>I inherited this code, and I don't think I can change the logic, so what
>can I do programatically to sync the form with the database?

Wait a minute... if your stored procedure is only doing validation, who is changing the database values? It sounds like the stored procedure is doing some updating. It should not be doing both. Separate the validation process from the update process--maybe into two procedures.

We have forms that call stored procedures to do updates, and they work fine. What your form should _really_ be doing is this: 1. Do all validation first. If it requires calling stored procedures, make sure they don't update the database -- they should only do validation.
2. If you are going to call a stored procedure to update some tables, then do a POST in the form.
3. Call any stored procedures that update tables. 4. Commit everything with a commit_form.

The fact that your form is returning the 40654 message is very troubling. Is your form trying to update the same items that the stored procedure is? If this is the case, then which one is correct, the stored procedure or the form? It sounds like something needs to be changed.

Hope this helps.
Steve Cosner Received on Tue Oct 01 1996 - 00:00:00 CEST

Original text of this message