====== pears.NetPersonShifts ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetPersonShifts"( in "pWebUserID" char(20) )
result( "Position" char(50),"Company" char(60),"ShiftDate" date,"TimeFrom" time,"TimeTo" time,"BreakMinutes" smallint,"State" char(1),"Description" char(50),"TheirRef" char(20),"TempShiftID" char(20),"Note" char(20),"OrderedBy" char(20),"ConfirmedWith" char(20) )
begin
select "vacancy"."Position",
"company"."name" as "Company",
"TempShift"."ShiftDate",
"TempShift"."TimeFrom",
"TempShift"."TimeTo",
"TempShift"."BreakMinutes",
"TempShift"."State",
"tempshiftplan"."Description",
"isnull"("tempshift"."referencecode","tempshiftplan"."referencecode") as "TheirRef",
"tempshift"."tempshiftid",
"TempShift"."Note",
"tempshiftplan"."OrderedBy",
"tempshift"."ConfirmedWith"
from "tempshift" key left outer join "tempshiftplan"
,"tempshift" key join "person"
,"tempshift" key join "vacancy" key join "employment" key join "company"
where "person"."personid" = any(select "personid" from "iqxnetuserlink" where "iqxnetuserid" = "pWebUserID")
--and tempshift.shiftdate >= current date
order by "TempShift"."ShiftDate" asc,"TempShift"."TimeFrom" asc
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetPersonShifts" IS
{create procedure pears."NetPersonShifts"( in "pWebUserID" char(20) )
result( "Position" char(50),"Company" char(60),"ShiftDate" date,"TimeFrom" time,"TimeTo" time,"BreakMinutes" smallint,"State" char(1),"Description" char(50),"TheirRef" char(20),"TempShiftID" char(20),"Note" char(20),"OrderedBy" char(20),"ConfirmedWith" char(20) )
begin
select "vacancy"."Position",
"company"."name" as "Company",
"TempShift"."ShiftDate",
"TempShift"."TimeFrom",
"TempShift"."TimeTo",
"TempShift"."BreakMinutes",
"TempShift"."State",
"tempshiftplan"."Description",
"isnull"("tempshift"."referencecode","tempshiftplan"."referencecode") as "TheirRef",
"tempshift"."tempshiftid",
"TempShift"."Note",
"tempshiftplan"."OrderedBy",
"tempshift"."ConfirmedWith"
from "tempshift" key left outer join "tempshiftplan"
,"tempshift" key join "person"
,"tempshift" key join "vacancy" key join "employment" key join "company"
where "person"."personid" = any(select "personid" from "iqxnetuserlink" where "iqxnetuserid" = "pWebUserID")
--and tempshift.shiftdate >= current date
order by "TempShift"."ShiftDate" asc,"TempShift"."TimeFrom" asc
end
}