JDBC: Update info in another table
I've been having trouble updating information in a secondary table and have decided to try taking a fresh approach - perhaps I'll get better joy.
I have a database with two tables which I'm interested in: MASTER, TAG
In MASTER the primary KEY is MST_SQ and in TAG the primary KEY is TAG_CODE. However, in TAG there is also an entry MST_SQ.
This would mean that for every tag a person has, they have a record in KEY with their MST_SQ.
When a person's account is disabled, I want to disable all the tags associated to them. The disabling of the tags in handled by setting a value in the TAG table (TAG_SUSPEND) to '1'.
If the MST_SQ is 10, this would mean that the SQL statement to disable all tags should be: update tag set tag_suspend=1 where mst_sq = 10
How do I achieve what I want? I would appreciate any assistance.
|