Database trigger problem

This is a discussion on Database trigger problem within the Tech Board forums, part of the Community Boards category; Hi , I have a problem.. i need to make sure that i should stop users from entering records inot ...

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Database trigger problem

    Hi ,
    I have a problem.. i need to make sure that i should stop users from entering records inot table that have the date fields in the past...

    I tried inserting a constraint to do this.. but the constraint says that the records that already exist do not follow the rule.. i thought about a trigger.. but how can i find the record i want to insert using a trigger because there will already be records that have date in the past.. and i dont want to use any client side checking.. want it to be in the database itself..

    thanx in advance

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    How can you apply a rule if your old data doesn't follow it?? I think any kind of trigger that you run would probably fail because of this. You almost have to do something at the client side that would check the DB for things that don't conform to your new request to add info.

  3. #3
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Originally posted by ober5861
    How can you apply a rule if your old data doesn't follow it?? I think any kind of trigger that you run would probably fail because of this. You almost have to do something at the client side that would check the DB for things that don't conform to your new request to add info.
    I just want to check when the new record is aded.. this check has to take place when only inserting it... Is there a psooibility i can detect this new record ina trigger so that i can check for validity for only this record..

  4. #4
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    bumping into more problems now..
    is there any way i can get the record i am trying to insert within a trigger..... ( i thought of something like timestamping but tat would not work if there are multiple insertion within a given time frame)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  2. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  3. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 04:06 PM
  4. Making a Simple Database System
    By Speedy5 in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2003, 09:17 PM
  5. File Database & Data Structure :: C++
    By kuphryn in forum C++ Programming
    Replies: 0
    Last Post: 02-24-2002, 10:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21