Re: Problems with the On-Insert trigger (Forms)

From: <jordi_gine_at_my-deja.com>
Date: Wed, 23 Aug 2000 15:13:49 GMT
Message-ID: <8o0pmo$lj2$1_at_nnrp1.deja.com>


In article <8nvo4m$sla$1_at_vkhdsu24.hda.hydro.com>,   "Marc Billiet" <MB.no_at_mail.reply> wrote:
> Forms gives you this error message if it sees a difference between
 the data
> in the block and the data in the database. Is it possible that you
 insert
> other values than the ones on screen, or not all columns ? After the
 insert,
> you should also retrieve the rowid into :block.rowid.

It worked!!
Thanks a lot.

> Note that I normally only use on-insert triggers when the block is
 based on
> a not-updatable view, otherwise you can as well use insert_record.
>
> Marc
>
The problem with insert_record was that I wanted to catch a exception caused by the insert statement in the on-insert trigger code, to re-issue the insert statement with different values. If I call insert_record and the exception raises, I have no way to catch it from the on-insert trigger, and then call again insert_record;

> jordi_gine_at_my-deja.com wrote in message <8ntj90
 $ulp$1_at_nnrp1.deja.com>...
> >Hello:
> >
> >I have redefined the on-insert trigger, to do some processing and
> >finally issue an insert statement.
> >This seems to work well, but if I try to update any of the fields
 after
> >inserting the record, I get the following error_message:
> >"frm-40654:Record has been updated by another user. Re-query to see
> >change"
> >
> >I have even removed all the extra processing in the trigger, leaving
> >only the insert statement but still get the error message.
> >On the other hand, if I redefine the on-Insert trigger and just call
> >the Insert_Record built-in everything works alright.
> >
> >Which is the difference between calling Insert_Record and directly
> >doing the insert statement?
> >Which code should I add to the insert to avoid the error message?
> >
> >Thanks in advance,
> > Jordi.
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Aug 23 2000 - 17:13:49 CEST

Original text of this message