Index: openacs-4/packages/survey/sql/oracle/survey-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/sql/oracle/survey-package-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/survey/sql/oracle/survey-package-create.sql 15 Sep 2002 23:57:20 -0000 1.1 +++ openacs-4/packages/survey/sql/oracle/survey-package-create.sql 12 Jun 2003 03:54:46 -0000 1.2 @@ -387,9 +387,11 @@ is v_user_id acs_objects.creation_user%TYPE; begin - select creation_user into v_user_id - from acs_objects - where object_id = survey_response.initial_response_id(initial_user_id.response_id); + select o.creation_user into v_user_id + from acs_objects o, + survey_responses s + where o.object_id = nvl(s.initial_response_id, s.response_id) + and s.response_id=initial_user_id.response_id; return v_user_id; end initial_user_id; Index: openacs-4/packages/survey/sql/postgresql/survey-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/sql/postgresql/survey-create.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/survey/sql/postgresql/survey-create.sql 17 May 2003 12:29:17 -0000 1.8 +++ openacs-4/packages/survey/sql/postgresql/survey-create.sql 12 Jun 2003 03:54:46 -0000 1.9 @@ -539,9 +539,12 @@ p_response_id alias for $1; v_user_id integer; begin - select into v_user_id creation_user - from acs_objects where - object_id = survey_response__initial_response_id(p_response_id); + select into v_user_id o.creation_user + from acs_objects o, + survey_responses s + where + object_id = coalesce(s.initial_response_id, s.response_id) + and s.response_id = p_response_id; return v_user_id; end;' language 'plpgsql'; @@ -558,8 +561,6 @@ PERFORM survey_response__del(v_response_row.response_id); end loop; - PERFORM survey_response__del(remove__response_id); - return 0; end;' language 'plpgsql';