Forum OpenACS Development: Re: content_folder.rename

Collapse
9: Re: content_folder.rename (response to 4)
Posted by Dirk Gomez on

Here's a good example where I think that this naming convention under Oracle is dangerous:


        procedure del (
                calendar_id             in calendars.calendar_id%TYPE
        )
        is
  
        begin
                  -- First erase all the item relate to this calendar.
                delete from     calendars 
                where           calendar_id = calendar.del.calendar_id;
 
                  -- Delete all privileges associate with this calendar
                delete from     acs_permissions 
                where           object_id = calendar.del.calendar_id;

                  -- Delete all privilges of the cal_items that's associated 
                  -- with this calendar
                delete from     acs_permissions
                where           object_id in (
                                        select  cal_item_id
                                        from    cal_items
                                        where   on_which_calendar = calendar.del.calendar_id                                                                                                                                                         
                                );
                        
 
                acs_object.del(calendar_id);
        end del;

It admittedly is more stylish, but it is error-prone (without throwing errors) and is potentially dangerous because it may delete loads of items.

Let me dig up a coding style proposal from Feuerstein's books once I am back from the Hamburg bug bash.