Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating from 2nd table when trigger updates table

Status
Not open for further replies.

anniez

IS-IT--Management
Apr 13, 2001
43
US
I have a trigger that updates several columns in tableA with new employee information including DeptCode.
tableB has Group and DeptCode.
AUD 211
AUD 210
AUD 390
ISM 110
ISM 490
REL 333
REL 334
Can I update the group from TableB for a matching deptcode in the same trigger?
Can you help me with the syntax?
thanks
 
hi anniez,
please use following update statment may be your problem will solve.......
in case no please explain your question more and describe the structure of both tables ...

update tab_a a
set a.group=(select substr(b.grp_dept,1,3)
from tab_b b
where a.dept=substr(b.grp_dept,5))


regards
Shahzad Zafar

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top