User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 361,940 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,612 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser:
Views: 495 | Replies: 1
Reply
Join Date: Mar 2008
Posts: 1
Reputation: maanasiiii is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
maanasiiii maanasiiii is offline Offline
Newbie Poster

Trigger help

  #1  
Mar 25th, 2008
I have to create a trigger having the following database. I'm confused in using the trigger type(row-level,st-type). Please help me out.


Consider the relation schema of the COMPANY database given below

EMPLOYEE (fname, minit, lname, ssn, birthdate, address, sex, salary, superssn, dno) KEY: ssn

DEPARTMENT (dname, dnumber, mgrssn, mgrstartdate)KEY: dnumber.

PROJECT (pname, pnumber, plocation, dnum)KEY: pnumber.

WORKS_ON (essn, pno, hours)KEY: (essn, pno)

DEPENDENT (essn, dependent-name, sex, bdate, relationship)
KEY: (essn, dependent-name)

The assignments of an employee –removed from the company- must be partially absorbed by his/her co-workers. Under this temporary policy 1/10 of the hours dedicated to a project will be uniformly distributed among her current project co-workers.

So, Example I have made for this businees rule is something like this. Consider employee 999222333 works in projects 10 and 20 for a total of 10 and 30 hours respectively. Her project 10 coworkers are {222333444, 444555666}. Similarly her project 20 coworkers are {222333444, 555666777, 777888999}. In order to enforce the new rule, employees {222333444, 444555666} will get an increment of ½ hour on their workload for project 10 [observe that 1/2 hour is computed as (10 hours * 1/10) / 2 emp)]. Likewise, employees {222333444, 555666777, 777888999} will see their weekly workload for project 20 increased by 1 hour [here 1 hour is computed as = (30 * 1/10)/3].


I am going to test the code which I'm trying on the employee 123456789 from the employee table which I have already created.

Thanks,
Manasi
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: India
Posts: 235
Reputation: Agni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 33
Sponsor
Agni's Avatar
Agni Agni is offline Offline
Posting Whiz in Training

Re: Trigger help

  #2  
Apr 17th, 2008
what will be the functionality of the trigger?.. if it's to distribute the load then i think it should be a row-level trigger.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Oracle Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Oracle Forum

All times are GMT -4. The time now is 11:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC