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 > Insert error

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-02-10, 08:18
calamaris calamaris is offline
Registered User
 
Join Date: Aug 2010
Posts: 21
Insert error

Hi every one . I created this trigger , but i can insert just one row information on my table
for example when insert first time information and want to insert antoher information Db2 return error for trigger


create trigger dec_num
after insert on sales
For each row mode db2sql
UPDATE product
SET pro_qty = pro_qty -1
where pro_id = (select pro_id from sales)
Reply With Quote
  #2 (permalink)  
Old 09-02-10, 08:49
singhipst singhipst is offline
Registered User
 
Join Date: Jul 2006
Location: Bangalore
Posts: 57
Check below clause

REFERENCING OLD AS OLD_TAB
NEW AS NEW_TAB
FOR EACH ROW MODE DB2SQL
UPDATE product
SET pro_qty = pro_qty -1
where pro_id =NEW_TAB.pro_id
__________________
Ritesh Kumar Singh
IBM Certified DB2 DBA for LUW
**Knowledge Is Theft If Not Shared !!**
Reply With Quote
  #3 (permalink)  
Old 09-02-10, 10:04
calamaris calamaris is offline
Registered User
 
Join Date: Aug 2010
Posts: 21
queastion

hi . i don't understand this code , because I'm beginner in database
Reply With Quote
Reply

Thread Tools
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