If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > newbie: db2 trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-05, 00:53
roustabout roustabout is offline
Registered User
 
Join Date: Jan 2005
Posts: 14
Question 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
Reply With Quote
  #2 (permalink)  
Old 01-19-05, 11:29
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
I think you already have your answer in another post: http://www.dbforums.com/showthread.p...=1#post4067402
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On