This discussion is archived
0 Replies Latest reply: Oct 17, 2009 11:54 AM by 705751 RSS

Creating Historical based Security Access Type

705751 Newbie
Currently Being Moderated
I am trying to create a Security Access Type for PPLJOB that will look at the Reg_Region of an employee and if the historical rows of JOB contain the reg_region, use the employee in a Data Permission for Security. I want to know if anyone has tried this before and how the SQLID for Where needed to be coded. I created a SQLID with the following statement which didn't pull any employees:

PA.EMPLID = JOB.EMPLID AND PA.EMPL_RCD = JOB.EMPL_RCD AND JOB.EFFDT = (SELECT MAX(EFFDT) FROM PS_JOB JOB2 WHERE JOB.EMPLID = JOB2.EMPLID AND JOB.EMPL_RCD = JOB2.EMPL_RCD AND JOB2.EFFDT <= %CurrentDateIn) AND JOB.EFFSEQ = (SELECT MAX(EFFSEQ) FROM PS_JOB JOB3 WHERE JOB.EMPLID = JOB3.EMPLID AND JOB.EMPL_RCD = JOB3.EMPL_RCD AND JOB.EFFDT = JOB3.EFFDT) AND JR.EMPLID = JOB.EMPLID AND JR.EMPL_RCD = JOB.EMPL_RCD AND JR.EFFDT = JOB.EFFDT AND JR.EFFSEQ = JOB.EFFSEQ AND JOB.REG_REGION <> %Bind(SCRTY_KEY1) AND EXISTS (SELECT 'X' FROM PS_JOB JOB4 WHERE JOB.EMPLID = JOB4.EMPLID AND JOB.EMPL_RCD = JOB4.EMPL_RCD AND JOB4.EFFDT < JOB.EFFDT AND JOB4.REG_REGION = %Bind(SCRTY_KEY1))

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points