Re: Passing parameters to table trigger

From: (wrong string) érôme PERRET <jperret_at_freesurf.fr>
Date: Thu, 4 Jan 2001 08:30:45 +0100
Message-ID: <9318s9$du0$1_at_wanadoo.fr>


Mike Krolewski <mkrolewski_at_rii.com> a écrit dans le message : 92vonf$dim$1_at_nnrp1.deja.com...
> In article <92va25$7k5$1_at_wanadoo.fr>,
> "Jérôme PERRET" <jperret_at_freesurf.fr> wrote:
> > Can I pass a value (like with a parameter to a procedure) from Forms
 to a
> > trigger based on a table ?
> >
> > Jérôme
> >
> >
>
>
> Simple answer, no.
>
> A table based trigger is activated any time a particular action is
> applied to the table. It has access to the data available in the action
> ( inserted columns, updated columns, etc) and any information commited
> to the database. You would be hard pressed to allow for more than one
> user of Forms to get a specific action using a trigger.
>
> If you need to perform some activity to a table from within Forms, you
> might consider writing a stored procedure to do the work. You have the
> available parameters, and you can control what is happening.
>
> However, you may have to override a lot of the internal processing of
> Forms. I would like to know what exactly you are trying to do. For

My question was to circumvent a problem I got in a Form (see discussion "I can't find the right trigger"). My problem is solved but I think it could be useful for future. So, this was I wanted to do. I got 3 tables : CLIENT, CONTACT, CONTACT_CLIENT CLIENT 0,n <--------> 1,1 CONTACT_CLIENT 1,1 <--------> 0,1 CONTACT

 Code                                        Client_Code
Code
 Desig                                        Contact_Code
Desig

What i call Code is the primary key of the table.

Each client has a certain number of contact. From form CLIENT, i got a push button called "Contacts" that call the form CONTACT passing in parameter the client's code. When I then insert a record to contact, I need to insert a record to CONTACT_CLIENT with both client and contact code. I so need to pass the client's code to the trigger BEFORE-INSERT of contact table. I finally do the job with a trigger in my form, passing value from table trigger to form with a packaged variable. I so think that I can to the opposite operation (passing parameter from form to table trigger) with the same method and my trigger got my value. But Is there an easier way ?

> instance, is a pre-insert trigger in your Form more appropriate? Is the
> action actually just a simple table trigger. Remember almost anything
> you are thinking about doing has already been done by someone else.
> Many of the improvements in Forms over the years are do to the needs of
> the developers.
>
> --
> Michael Krolewski
> Rosetta Inpharmatics
> mkrolewski_at_rii.com
> Usual disclaimers
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Thu Jan 04 2001 - 08:30:45 CET

Original text of this message