Re: Trigger using results from other trigger
[prev]
[thread]
[next]
[Date index for 2005/04/03]
--On April 3, 2005 11:46:53 AM -0700 Peter Speltz <peterspeltz@xxxxx.xxx>
wrote:
> In general can you use results (column values set) in one before create
> trigger in the next before create trigger? The manual says : "you cannot
> specify the order in which they will run". Does this mean you can't know
> the order they will run?
Yes. They're stored in a hash, so the order of retrieval isn't predefined.
> In specific (specifically),
> I have a class, Dialup, with an is_a relationship to IntrntSrvc. The is_a
> sets a before create trigger to create the IntrntSrvc object. I want to
> use the IntrntSrvc object's id as the id for Dialup. I couldn't set the
> is_a on Dialup's id cause of inflation issues so Dialup just has two
> columns with same value.
>
> What's best way to do this?
That could be tough, depending on what assumption C::D::R::IsA's trigger
makes. You could write your trigger to create the IntrntSrvc object if
needed, but that depends on the IsA trigger knowing enough not to try to
create the object again (just using find_or_create would work).
--
Regards,
Charles Bailey < bailey _at_ newman _dot_ upenn _dot_ edu >
Newman Center at the University of Pennsylvania
|
|
Re: Trigger using results from other trigger
Charles Bailey 23:17 on 03 Apr 2005
|