Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Design Question: Trigger? Stored Procedure?

Re: Design Question: Trigger? Stored Procedure?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 09 Feb 2000 18:18:56 +0800
Message-ID: <38A13F10.6625@yahoo.com>


Ken Rachynski wrote:
>
> Good day,
>
> I have a table as follows:
>
> CREATE TABLE PRODUCTMIX (
> PROJECT_LEAD_ID NUMBER( 38 ) NOT NULL,
> PRODUCT_TYPE VARCHAR2(50) NOT NULL,
> PERCENT NUMBER(5,2) NOT NULL,
> CONSTRAINT PK_PRODUCTMIX
> PRIMARY KEY ( PROJECT_LEAD_ID, PRODUCT_TYPE )
> )
>
> Basically, it lets me store the different product types used on each
> project. I have a business rule that says "for each project number, the
> total percent of products must equal 100 percent".
>
> My question is: how can I implement this when the user enters each product
> separately? Should I consider moving the logic to the front end instead of
> using the server to handle it? I would prefer to have the server handle
> this because I have several front ends.
>
> Thanks in advance for any suggestions.
>
> --
> Ken Rachynski
> Database Analyst
> Evans Consoles
> http://evansonline.com/

You should be able to implement this with triggers and package variables.

The package variables will probably by required to avoid mutating table problems. For an example, see

http://govt.oracle.com/~tkyte/Mutate/index.html --



Connor McDonald
connor_mcdonald_at_yahoo.com

There are 3,434,679 oracle websites around the world. Now there is one more... http://www.oracledba.co.uk Received on Wed Feb 09 2000 - 04:18:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US