====== pears.NetOwnerRateDetails ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create procedure "pears"."NetOwnerRateDetails"( in "pWebUserId" char(20),in "pTempJobTypeID" char(20) ) result( "ObjID" char(20),"TempPayBandID" char(20),"Description" char(50),"Units" char(20),"Pay_Rate" char(10),"Charge_Rate" char(10) ) 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"("pTempJobTypeID",'') = '' then select 'New','','','','','' else select "r"."TempJobRateID" as "ObjID", "b"."TempPayBandID" as "TempPayBandID", "b"."Description" as "Description", "b"."Unit" as "Units", "trim"("str"("r"."payrate",12,2)) as "Pay_Rate", "trim"("str"("r"."chargerate",12,2)) as "Charge_Rate" from "TempJobRate" as "r" key join "TempPayBand" as "b" key join "vacancy" key join "employment" key join "company" where "r"."vacancyid" = "pTempJobTypeID" and "company"."divisionid" = "divid" end if end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerRateDetails" IS {create procedure pears."NetOwnerRateDetails"( in "pWebUserId" char(20),in "pTempJobTypeID" char(20) ) result( "ObjID" char(20),"TempPayBandID" char(20),"Description" char(50),"Units" char(20),"Pay_Rate" char(10),"Charge_Rate" char(10) ) 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"("pTempJobTypeID",'') = '' then select 'New','','','','','' else select "r"."TempJobRateID" as "ObjID", "b"."TempPayBandID" as "TempPayBandID", "b"."Description" as "Description", "b"."Unit" as "Units", "trim"("str"("r"."payrate",12,2)) as "Pay_Rate", "trim"("str"("r"."chargerate",12,2)) as "Charge_Rate" from "TempJobRate" as "r" key join "TempPayBand" as "b" key join "vacancy" key join "employment" key join "company" where "r"."vacancyid" = "pTempJobTypeID" and "company"."divisionid" = "divid" end if end }