Query to Retrieve all Records under a Specific Component

Your rating: None Average: 3.1 (9 votes)

Following is the query that can be useful to find out all records under a specified component. All it requires is the component name, and type of record you want to check For example pass value as "0" to retrieve only record type as 'Table' under specified component

SELECT DISTINCT (recname)
FROM psrecdefn
WHERE 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 = 'VNDR_ID' -- specify your 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 = 'VNDR_ID') -- specify your component name)
AND recname <> ' ')
AND rectype = '0' -- specify record type
ORDER BY recname ASC

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
Lepa's picture
User offline. Last seen 3 weeks 5 days ago. Offline
Joined: 06/23/2008
Posts: 591
Re: Query to Retrieve all Records under a Specific Component

Thanks PS_Tatva and welcome to the site!

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: Query to Retrieve all Records under a Specific Component

thank..........

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
4 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.