====== pears.NetOwnerCompanyDetails ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetOwnerCompanyDetails"( in "pWebUserID" char(20),in "pCompanyID" char(20) )
result( "ObjID" char(20),"Company_Name" char(60),"Address_Line_1" char(40),"Address_Line_2" char(40),"Address_Line_3" char(40),"Town" char(30),"County" char(30),"Country" char(30),"Postcode" char(20),"Phone" char(100),"Fax" char(100),"Web_Site" char(100) )
begin
declare "divid" char(20);
set "divid" = (select first "staff"."divisionid" from "iqxnetuser" key join "staff" where "iqxnetuser"."iqxnetuserid" = "pwebuserid");
if "divid" is null then
return
end if;
if "isnull"("pCompanyID",'') = '' then
select '','','','','','','','','','','',''
else
select "Company"."companyid" as "ObjID",
"Company"."Name" as "Company_Name",
"Company"."addr1" as "Address_Line_1",
"Company"."addr2" as "Address_Line_2",
"Company"."addr3" as "Address_Line_3",
"Company"."town" as "Town",
"Company"."county" as "County",
"Company"."country" as "Country",
"Company"."postcode" as "Postcode",
"getphone"('C','Telephone',"Company"."companyid") as "Phone",
"getphone"('C','Fax',"Company"."companyid") as "Fax",
"getphone"('C','Web Site',"Company"."companyid") as "Web_Site"
from "company"
where "companyid" = "pCompanyID" and "divisionid" = "divid"
end if
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerCompanyDetails" IS
{create procedure pears."NetOwnerCompanyDetails"( in "pWebUserID" char(20),in "pCompanyID" char(20) )
result( "ObjID" char(20),"Company_Name" char(60),"Address_Line_1" char(40),"Address_Line_2" char(40),"Address_Line_3" char(40),"Town" char(30),"County" char(30),"Country" char(30),"Postcode" char(20),"Phone" char(100),"Fax" char(100),"Web_Site" char(100) )
begin
declare "divid" char(20);
set "divid" = (select first "staff"."divisionid" from "iqxnetuser" key join "staff" where "iqxnetuser"."iqxnetuserid" = "pwebuserid");
if "divid" is null then
return
end if;
if "isnull"("pCompanyID",'') = '' then
select '','','','','','','','','','','',''
else
select "Company"."companyid" as "ObjID",
"Company"."Name" as "Company_Name",
"Company"."addr1" as "Address_Line_1",
"Company"."addr2" as "Address_Line_2",
"Company"."addr3" as "Address_Line_3",
"Company"."town" as "Town",
"Company"."county" as "County",
"Company"."country" as "Country",
"Company"."postcode" as "Postcode",
"getphone"('C','Telephone',"Company"."companyid") as "Phone",
"getphone"('C','Fax',"Company"."companyid") as "Fax",
"getphone"('C','Web Site',"Company"."companyid") as "Web_Site"
from "company"
where "companyid" = "pCompanyID" and "divisionid" = "divid"
end if
end
}