Forum OpenACS Development: Re: update query problem

Collapse
2: Re: update query problem (response to 1)
Posted by russ m on
how did you express the query using EXISTS? I'd think this should work -

UPDATE ccf_claim_records
SET ccf_claim_records.processed = true
WHERE ccf_claim_records.processed = false
AND ccf_claim_records.supervisor_id = :s_id
AND EXISTS (
  SELECT 1 from acs_objects
  WHERE acs_objects.object_id = ccf_claim_records.claim_record_id
  AND acs_objects.creation_user = :id
)

which will mark as processed all records for a particular user/supervisor pair...