====== pears.contactview ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Consolidates a range of information linked to a Contact Event record
===== Original SQL =====
create view "pears"."contactview"( "cname",
"ckeyname","companyid","cpname","cpkeyname",
"cppersonid","pname","pkeyname","ppersonid","userid","staffid","cpemploymentid",
"contacteventid","contactdate","contacttime","outcome","callbackdate","description","class",
"classcode","position","vacancyid","progressid","placementid","employmentid",
"personid","followup","timestring","divisionid","callbacktime" ) as select "contactcompany"."cname","contactcompany"."ckeyname","contactcompany"."companyid","contactcompany"."cpname","contactcompany"."cpkeyname","contactcompany"."cppersonid",
"contactperson"."pname","contactperson"."pkeyname","contactperson"."ppersonid","staff"."userid","contactevent"."staffid","contactevent"."employmentid",
"contactevent"."contacteventid","contactevent"."contactdate","contactevent"."contacttime","contactevent"."outcome","contactevent"."callbackdate","contactevent"."description",
"contactclass"."classdescrip","contactevent"."classcode","pears"."getcontactposition"("contactevent"."vacancyid",
"contactevent"."progressid","contactevent"."placementid"),"contactevent"."vacancyid",
"contactevent"."progressid","contactevent"."placementid","contactevent"."employmentid",
"contactevent"."personid","contactevent"."followup",cast("contactevent"."contacttime" as char),"contactevent"."divisionid","contactevent"."callbacktime" from "pears"."contactevent"
key join("pears"."contactclass","pears"."staff") join "pears"."contactperson"
on "contactevent"."contacteventid" = "contactperson"."contacteventid"
join "pears"."contactcompany"
on "contactevent"."contacteventid" = "contactcompany"."contacteventid"
go
COMMENT ON VIEW "pears"."contactview" IS
'Consolidates a range of information linked to a Contact Event record'
go
COMMENT TO PRESERVE FORMAT ON VIEW "pears"."contactview" IS
{create view contactview
(cname,ckeyname,companyid,cpname,cpkeyname,
cppersonid,pname,pkeyname,ppersonid,userid,staffid,cpemploymentid,
contacteventid,contactdate,contacttime,outcome,callbackdate,description,class,
classcode,position,vacancyid,progressid,placementid,employmentid,
personid,followup,timestring,divisionid,callbacktime) as select cname,ckeyname,contactcompany.companyid,cpname,cpkeyname,cppersonid,
pname,pkeyname,ppersonid,userid,contactevent.staffid,employmentid,
contactevent.contacteventid,contactdate,contacttime,outcome,callbackdate,description,
classdescrip,contactevent.classcode,pears.getcontactposition(contactevent.vacancyid,
contactevent.progressid,contactevent.placementid),contactevent.vacancyid,
contactevent.progressid,contactevent.placementid,contactevent.employmentid,
contactevent.personid,contactevent.followup,cast(contacttime as char),contactevent.divisionid, callbacktime from pears.contactevent
key join(pears.contactclass,pears.staff) join pears.contactperson
on contactevent.contacteventid=contactperson.contacteventid join
pears.contactcompany
on contactevent.contacteventid=contactcompany.contacteventid
}