Table of Contents



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
}