Re: Question on Insert Trigger

From: DA Morgan <>
Date: Sat, 08 Mar 2008 17:32:42 -0800
Message-ID: <>

Serge Rielau wrote:
> DA Morgan wrote:

>> Serge Rielau wrote:
>>> Hypothetically: If the business rule depends on data in some table or 
>>> a package variable (any sort of "external to the row" data), can it 
>>> still be written as a constraint?
>>> Presumably VPD cannot "ignore" input data, so it isn't applicable 
>>> here I guess.
>> My initial answer is no but business rules, as we define them are
>> not the kind of thing one would write to a package variable. If it
>> is variable it is not a rule.

> "We"? Is ACE a royal title?
> Variables come in shades of grey.
> If it changes once a year it's still a variable.
> Anyway not worth fighting about, it was after all hypothetical.
> I made my proposal and it's up the OP to consider it.
> Cheers
> Serge

Package variables retain their value for the life of a session. Log off and they are gone. Open a second session and they may or may not be identical with those in the first session. That is no way to enforce a business rule. With a constraint you know the rule will always be the same in every session, day after day, year after year.

Lets just stick with the fact that the OP, probably showing more wisdom than both of us, has not posted here since. <g>

But I am wondering ... would you use a package variable, when you get them into DB2, to enforce a business rule?

With respect to your other question:

Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington (replace x with u to respond)
Puget Sound Oracle Users Group
Received on Sat Mar 08 2008 - 19:32:42 CST

Original text of this message