====== pears.StaffInfo ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
View - Adds Branch - Division etc information to StaffID and name.
===== Original SQL =====
create view "pears"."StaffInfo"( "staffid",
"name","title","shortid","tempdesk","division","agency","department" )
as select "staff"."staffid","staff"."name","staff"."title","staff"."shortid",
(select "tempdesk"."name" from "pears"."tempdesk" where "staff"."tempdeskid" = "tempdesk"."tempdeskid"),
(select "division"."name" from "pears"."division" where "staff"."divisionid" = "division"."divisionid"),
(select "agencydetails"."name" from "pears"."agencydetails" where "staff"."agencyid" = "agencydetails"."agencyid"),
(select "department"."name" from "pears"."department" where "staff"."defaultdepartid" = "department"."departmentid")
from "pears"."staff"
go
COMMENT ON VIEW "pears"."StaffInfo" IS
'View - Adds Branch - Division etc information to StaffID and name.'
go
COMMENT TO PRESERVE FORMAT ON VIEW "pears"."StaffInfo" IS
{create view StaffInfo
(staffid,"name",title,shortid,tempdesk,division,agency,department)
as select staffid,"name",title,shortid,
(select "name" from pears.tempdesk where staff.tempdeskid=tempdesk.tempdeskid),
(select "name" from pears.division where staff.divisionid=division.divisionid),
(select "name" from pears.agencydetails where staff.agencyid=agencydetails.agencyid),
(select "name" from pears.department where staff.defaultdepartid=department.departmentid)
from pears.staff
}