====== pears.InsertCIS07FromTemplate ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."InsertCIS07FromTemplate"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in @PersonID char(20) )
begin
declare @UniqueTaxReference char(20);
declare @CISVerificationNumber char(20);
declare @CISTaxTreatment char(10);
declare @CISVerificationDate date;
declare @CISEffectiveDate date;
declare "idum" smallint;
select "CIS07Template"."UniqueTaxReference",
"CIS07Template"."CISVerificationNumber",
"CIS07Template"."CISTaxTreatment",
"CIS07Template"."CISVerificationDate",
"CIS07Template"."CISEffectiveDate" into @UniqueTaxReference,
@CISVerificationNumber,
@CISTaxTreatment,
@CISVerificationDate,
@CISEffectiveDate from "CIS07Template" key join "Pay_Employee" where "Pay_Employee"."PersonID" = @PersonID;
update "pay_employee"
set "UniqueTaxReference" = @UniqueTaxReference,
"CISVerificationNumber" = @CISVerificationNumber,
"CISTaxTreatment" = @CISTaxTreatment,
"CISVerificationDate" = @CISVerificationDate,
"CISEffectiveDate" = @CISEffectiveDate
where "Pay_Employee"."PersonID" = @PersonID
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."InsertCIS07FromTemplate" IS
{create procedure InsertCIS07FromTemplate
/* Application Maintained Function / Procedure - DO NOT EDIT*/
(in @PersonID char(20))
begin
declare @UniqueTaxReference char(20);
declare @CISVerificationNumber char(20);
declare @CISTaxTreatment char(10);
declare @CISVerificationDate date;
declare @CISEffectiveDate date;
declare idum smallint;
select CIS07Template.UniqueTaxReference,
CIS07Template.CISVerificationNumber,
CIS07Template.CISTaxTreatment,
CIS07Template.CISVerificationDate,
CIS07Template.CISEffectiveDate into @UniqueTaxReference,
@CISVerificationNumber,
@CISTaxTreatment,
@CISVerificationDate,
@CISEffectiveDate from CIS07Template key join Pay_Employee where Pay_Employee.PersonID = @PersonID;
update pay_employee set
UniqueTaxReference = @UniqueTaxReference,
CISVerificationNumber = @CISVerificationNumber,
CISTaxTreatment = @CISTaxTreatment,
CISVerificationDate = @CISVerificationDate,
CISEffectiveDate = @CISEffectiveDate where
Pay_Employee.PersonID = @PersonID
end
}