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.GetCompanyAddressOnLine ====== <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"."GetCompanyAddressOnLine"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "reqcompanyid" char(20) ) returns char(250) begin declare "AddressOnLine" char(250); declare "addr1" char(40); declare "addr2" char(40); declare "addr3" char(40); declare "town" char(30); declare "county" char(30); declare "country" char(30); declare "postcode" char(30); select "company"."addr1","company"."addr2","company"."addr3","company"."town","company"."county","company"."country","company"."postcode" into "addr1", "addr2","addr3","town","county","country","postcode" from "company" where "companyid" = "reqcompanyid"; if "isnull"("addr1",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("addr1") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("addr2",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ', ' end if; if "isnull"("addr2",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("addr2") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("addr3",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ', ' end if; if "isnull"("addr3",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("addr3") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("town",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ', ' end if; if "isnull"("town",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("town") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("county",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ', ' end if; if "isnull"("county",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("county") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("country",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ', ' end if; if "isnull"("country",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("country") end if; if "isnull"("AddressOnLine",'') <> '' and "isnull"("postcode",'') <> '' then set "AddressOnLine" = "AddressOnLine" || ' ' end if; if "isnull"("postcode",'') <> '' then set "AddressOnLine" = "AddressOnLine" || "trim"("postcode") end if; return "AddressOnLine" end </code> database/functions/pears_getcompanyaddressonline.txt Last modified: 2026/08/07 19:24by 127.0.0.1