Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Posts
    14

    Question Unanswered: newbie: db2 trigger

    Hi all,

    What syntax command should I use so that the user will not allow to insert value if the value is greater than 100 and a msg will be prompted with respect to prof_id. prof_id can appear more than once.

    Code:
    create trigger percent
    before insert on dept_assign
    when(select prof_id, sum(dept_assign_percent) 
    from dept_assign group 
    by prof_id 
    having sum(dept_assign_percent) > 100)
    
    begin
    
    <msg>
    
    end;
    Please Advise. Thank you very much

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    I think you already have your answer in another post: http://www.dbforums.com/showthread.p...=1#post4067402

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •