Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.DBCleanupOldRecentObjects ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."DBCleanupOldRecentObjects" IS {create function DBCleanupOldRecentObjects /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in age integer, in sid char(20), in countordo char(1)) returns integer begin declare @RC integer; declare @Staff char(20); select count(*) into @RC from RecentObjects where staffid like sid and LastViewed <= current date-age; if countordo = 'C' then return @RC end if; delete from RecentObjects where staffid like sid and LastViewed <= current date-age; if sid = '%' then set @staff = 'All' else select name into @staff from staff where staffid = sid; end if; call AuditLog('CLEANUP',sid,string(@RC,' Old Recent Objects deleted ',age,' days old for ',@staff),null,null); return @RC; end } </code> database/procedures/pears_dbcleanupoldrecentobjects.txt Last modified: 2026/08/07 19:24by 127.0.0.1