Skip to Content
author's profile photo Former Member
Former Member

Master - detail datawindow

Hi all,

I have 2 tables in a master - detail relationship.

I want to create a datawindow where all the records from master table A are shown, and possible records from detail table B.

When there's no detail record in table B, i still want to show the master record from table A.

I've been playing around with the LEFT JOIN and UNION solutions , but the way i created my sql , results in a slow retrieval of the datawindow.

Any tips or idea's on how to accomplish this please ?

TIA

John

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2015 at 07:33 AM

    Why don't use 2 datawindows? 1 for master and 1 for detail. At rowfocuschanged event inside dw_master, add the script to retrieve dw_detail with the retrieval argument parameter(s).

    Each dw represent each table.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2015 at 08:03 AM

    Be aware that a UNION performs a sort to eliminate duplicates. Do you want that? If not, use UNION ALL. Also, how are you joining? Is your SQL doing full table scans by any chance? Do you have properly indexed columns as part of the join condition?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.