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 > Update row

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-09, 17:13
ElenaVas ElenaVas is offline
Registered User
 
Join Date: Nov 2009
Posts: 5
Update row

Hello!

I would like to create insert-trigger on table A1, that will update the value in table A2. The value is intermed. I should update only 1 cell in A2, not column..
How can I do it?

for example,


CREATE TRIGGER My_INSERT
AFTER INSERT ON A1

FOR EACH ROW MODE DB2SQL

BEGIN ATOMIC
....

SET ???? = intermed;
END@

Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-18-09, 19:37
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
What is "intermed"?
From where it came? A column of table A1?

Does "only 1 cell" mean "only 1 row"?
If so, you should specify WHERE clause in your update statement in your trigger.
Reply With Quote
  #3 (permalink)  
Old 11-19-09, 20:47
ElenaVas ElenaVas is offline
Registered User
 
Join Date: Nov 2009
Posts: 5
Thanks for answer!
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