1 CREATE OR REPLACE FUNCTION SetArtifactLastModifiedDate() RETURNS int4 AS '
5 FOR r IN select artifact_id,open_date from artifact where last_modified_date IS NULL LOOP
6 UPDATE artifact set last_modified_date = open_date where artifact_id = r.artifact_id;
12 SELECT SetArtifactLastModifiedDate() as output;