J
Joost de Vries
Hi,
I'm currently working on a script that will be executed when someone deletes
a "team" entry from a quality control database. The database contains teams,
employees and samples (each employee belongs to a team and for each employee
samples can be registered). Each sample has two references to the empolyees
table: "employee" and "registrant" (always two different id's).
What I want to achieve now is that when a team is deleted, all samples that
have a registrant of the deleted team linked will now link to a so-called
"expired registrant" from their own team.
My query now looks like this:
UPDATE samples
INNER JOIN employees As emplT ON
samples.employee=emplT.empolyee_id
SET samples.registrant=(SELECT TOP 1
employee_id FROM employees
WHERE last_name="** EXPIRED **"
AND team=emplT.team)
When I try to execute this I get the error that "The query must be
updatable"... Any ideas how to sove this?
I'm currently working on a script that will be executed when someone deletes
a "team" entry from a quality control database. The database contains teams,
employees and samples (each employee belongs to a team and for each employee
samples can be registered). Each sample has two references to the empolyees
table: "employee" and "registrant" (always two different id's).
What I want to achieve now is that when a team is deleted, all samples that
have a registrant of the deleted team linked will now link to a so-called
"expired registrant" from their own team.
My query now looks like this:
UPDATE samples
INNER JOIN employees As emplT ON
samples.employee=emplT.empolyee_id
SET samples.registrant=(SELECT TOP 1
employee_id FROM employees
WHERE last_name="** EXPIRED **"
AND team=emplT.team)
When I try to execute this I get the error that "The query must be
updatable"... Any ideas how to sove this?