SQL Query for Retrieve all Records associated with a PeopleSoft Component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
SELECT R.RECNAME AS RECORD_NAME, ( CASE WHEN R.RECTYPE = 0 THEN 'Table' WHEN R.RECTYPE = 1 THEN 'View' WHEN R.RECTYPE = 2 THEN 'Derived' WHEN R.RECTYPE = 3 THEN 'Sub Record' WHEN R.RECTYPE = 5 THEN 'Dynamic View' WHEN R.RECTYPE = 6 THEN 'Query View' WHEN R.RECTYPE = 7 THEN 'Temporary Table' ELSE 'Unknown' END ) AS RECORD_TYPE FROM PSRECDEFN R WHERE R.RECNAME IN (SELECT DISTINCT RECNAME FROM PSPNLFIELD WHERE PNLNAME IN (SELECT DISTINCT B.PNLNAME FROM PSPNLGROUP A, PSPNLFIELD B WHERE ( A.PNLNAME = B.PNLNAME OR A.PNLNAME = B.SUBPNLNAME ) AND A.PNLGRPNAME='JOB_DATA' /*Component Name*/ AND RECNAME <> ' ') UNION SELECT DISTINCT RECNAME FROM PSPNLFIELD WHERE PNLNAME IN (SELECT DISTINCT B.SUBPNLNAME FROM PSPNLGROUP A, PSPNLFIELD B WHERE ( A.PNLNAME = B.PNLNAME OR A.PNLNAME = B.SUBPNLNAME ) AND A.PNLGRPNAME='JOB_DATA'/*Component Name*/ )) AND R.RECNAME <> ' ' ORDER BY R.RECTYPE ; |
Result SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
SELECT DISTINCT cp.pnlgrpname, cp.market, cp.descr, pgf.recname, r.recdescr, r.rectype FROM pspnlgrpdefn cp, pspnlgroup cpg, pspnldefn pg, pspnlfield pgf, psrecdefn r WHERE cp.pnlgrpname = 'JOB_DATA' /* Component Name*/ AND cp.market = 'GBL' AND cp.pnlgrpname = cpg.pnlgrpname AND cp.market = cp.market AND pg.pnlname = cpg.pnlname AND pgf.pnlname = pg.pnlname AND pgf.recname = r.recname; |
Result query
Reference : https://hmahanta.blogspot.com/2021/07/useful-quesries-in-peoplesoft.html