473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

When to use triggers or not

348 100+
I have another question that I don't know how to answer. In my database I have a table with schedules. Each employee is assigned to one schedule. After thinking about this, I wonder what will happen if employee1 calls in sick and employee2 (Assigned to a completely different schedule) has to cover employee1's shift.

I think that the database should not allow employee2 to entered because remember, employee2 is assigned a totally different shift.

How should I go about fixing this? Should I use triggers for this?

Thanks,

Frank
Sep 24 '07 #1
3 1424
fjm
348 100+
I have another question that I don't know how to answer. In my database I have a table with schedules. Each employee is assigned to one schedule. After thinking about this, I wonder what will happen if employee1 calls in sick and employee2 (Assigned to a completely different schedule) has to cover employee1's shift.

I think that the database should not allow employee2 to entered because remember, employee2 is assigned a totally different shift.

How should I go about fixing this? Should I use triggers for this?

Thanks,

Frank
Hey guys, was my question that far out in left field? :)
Sep 25 '07 #2
Atli
5,058 Expert 4TB
Hey guys, was my question that far out in left field? :)
:)

I've never used triggers much, so I only know them in theory.

However.. I can suggest two solutions!

First: Don't assign each worker to a schedule. Assign each "login" (or whatever you call it) to a schedule. That way your workers can do a different schedule every day and your database has nothing to complain about.

Second: Don't allow your workers to change schedules! If one of them gets sick and somebody else needs to cover for him/her, have the substitute login as the first one and let them work the details out between them selves :)
(Caution, this method may cause extreme frustration, confusion and petty disagreements between your workers!)
Sep 25 '07 #3
fjm
348 100+
(Caution, this method may cause extreme frustration, confusion and petty disagreements between your workers!)
Hi Atli,

Thank you for responding.. Ok. I will redo some of the relationships to reflect that. As far as the frustration goes, as long as it is directed between themselves, and I'm not present, its all good. :)

Frank
Sep 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Simon | last post by:
Hi I am trying to produce an update trigger. I understand the concept of delete and insert triggers without a problem. Unfortuantely, the update triggers do not have particularly simple...
10
by: Brian McGee | last post by:
I have a database with over 450 tables, that until a short while ago has been strictly 3NF. In cases where complicated permutations of data are required quickly for certain parts of the system,...
1
by: jason_s_ford | last post by:
I have several sql server databases that were recently moved to a new server. In the process of migrating the databases, any triggers and constraints attached to tables were removed on accident. ...
4
by: Mark Flippin | last post by:
I'm just starting to use triggers in my databases and find the support in Enterpise Manager lacking. Using Enterprise Manager and Query Analyzer you can maintain the triggers, but it's...
5
by: Bruce | last post by:
I have several user defined functions which are referenced in triggers and views. For software upgrades, I need to be able to drop the triggers and views which reference these user defined...
10
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after...
7
by: ajomara | last post by:
Hai everyboby i am new to this group,can one help me in triggers could anyone help in the fallowing lines "Database triggers can be system triggers on a database or a schema. With a...
3
by: rick | last post by:
Hi I m new to DB2, Please bear with me if this is silly question, but i need to know how to copy(only triggers) 400 triggers from one data base to another on same server and also onto different...
0
debasisdas
by: debasisdas | last post by:
trigger sample code Ex#10 ======================= INSTEAD OF TRIGGER ---------------------------------------- create or replace trigger mytrig instead of delete or insert or update on eview...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.