Index: openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql	4 Sep 2001 04:50:05 -0000	1.3
+++ openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql	13 Mar 2002 22:50:53 -0000	1.4
@@ -496,6 +496,7 @@
   object_id	in acs_objects.object_id%TYPE
  )
  is
+   v_exists_p char;
  begin
   
   -- Delete dynamic/generic attributes
@@ -509,11 +510,19 @@
                                 where o.object_id = acs_object.delete.object_id)
       connect by object_type = prior supertype)
   loop
-    -- Delete from the table.
-    execute immediate 'delete from ' || object_type.table_name ||
+    -- Delete from the table if it exists.
+    select decode(count(*),0,'f','t') into v_exists_p
+    from user_tables
+    where table_name = upper(object_type.table_name);
+
+    if v_exists_p = 't' then
+      execute immediate 'delete from ' || object_type.table_name ||
         ' where ' || object_type.id_column || ' = :object_id'
-    using in object_id;
+      using in object_id;
+    end if;
+
   end loop;
+
  end delete;
 
  function name (
