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.CollectionDeleteAllowed ====== <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> create function "pears"."CollectionDeleteAllowed"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "pCollectionid" char(20) ) returns long varchar begin declare "rv" long varchar; declare "collectioncount" integer; set "rv" = ''; if not exists(select * from "collection" where "collectionid" = "pCollectionid") then return "string"('Collection not found') end if; select "count"() into "collectioncount" from "collection" where "parent" = "pCollectionid"; if "collectioncount" > 0 then set "rv" = "string"('Collection has ',"collectioncount",' children') end if; select "count"() into "collectioncount" from "collectionchat" where "collectionid" = "pcollectionid"; if "collectioncount" > 0 then set "rv" = "trim"("string"("rv","char"(13),"char"(10),'Collection has ',"collectioncount",' messages')) end if; return "rv" end </code> database/functions/pears_collectiondeleteallowed.txt Last modified: 2026/08/07 19:24by 127.0.0.1