Index: openacs-4/contrib/packages/survey/sql/oracle/survey-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/sql/oracle/Attic/survey-package-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/survey/sql/oracle/survey-package-create.sql	30 Sep 2003 12:10:01 -0000	1.2
+++ openacs-4/contrib/packages/survey/sql/oracle/survey-package-create.sql	26 Jan 2004 15:39:41 -0000	1.3
@@ -229,7 +229,8 @@
 	v_response_row survey_responses%ROWTYPE;
 	v_section_row survey_sections%ROWTYPE;
     begin
-
+    delete from survey_branches where section_id in (select section_id from survey_sections where survey_id=remove.survey_id);
+    delete from survey_conditions where question_id in (select question_id from survey_questions q, survey_sections s where s.section_id=q.section_id and s.survey_id=remove.survey_id);
 	for v_response_row in (select response_id
 		from survey_responses
 		where survey_id=remove.survey_id
@@ -309,6 +310,8 @@
     ) is
 	v_question_row survey_questions%ROWTYPE;
     begin
+        delete from survey_branches where section_id=remove.section_id;
+        delete from survey_conditions where question_id in (select question_id from survey_questions where section_id=remove.section_id);
 	for v_question_row in (select question_id
 		from survey_questions
 		where section_id=remove.section_id) loop
