Friday, 23 November 2007

How to delete/purge OPRID outside PS?

Peoplesoft provides an online page to delete OPRID. However, this can become cumbersome if you need to purge or delete 10+ OPRID’s as part of your cleanup exercise. I have created the below PL/SQL script which basically mimics what the online purge process executes.
DECLARE
CURSOR C1 IS
SELECT decode(A.SQLTABLENAME,’ ‘,’PS_’||A.RECNAME,A.SQLTABLENAME) RECNAME
FROM PSRECDEFN A
WHERE RECNAME IN (SELECT RECNAME FROM PS_TBLSELECTION_VW)
AND RECNAME != ‘PSOPRDEFN’
ORDER BY 1;
CURSOR C2 IS
SELECT decode(B.SQLTABLENAME,’ ‘,’PS_’||B.RECNAME,B.SQLTABLENAME) RECNAME
FROM PSRECDEFN B
WHERE
RECNAME IN (SELECT RECNAME FROM PS_ROLEUSR_TBLS_VW)
AND RECNAME != ‘PSOPRDEFN’

Read More About OPRID

0 comments:

Post a Comment