groundclutter
Programmer
Hi and thanks for reading.
<b><u>Problem:</u></b>
Our current Oracle8 database schema has a table, e.g. "header", that has two related detail tables, e.g. "detail1" and "detail2". They are related in the following way:
<i>header.key --> detail1.header_key</i> and
<i>header.key --> detail2.header_key</i>
When developing reports (in Crystal Reports 8.5), the query brings back the following dataset:
<i>header.*, detail1.*, and detail2.*</i> but the details are never in the same row since they are exclusive resulting in two rows for every one header.
The biggest problem is when the requirement is to group by one "detail1" field and one "detail2" field. What happens is that the details are split out and then grouped with basically duplicates the header.
<b><u>Question:</u></b>
What I am looking to do is create a dynamic view (or should i be using a stored procedure) that would collect the data as one row (on the server side) and then I could use that view (or temp table) as my data source for the report.
I have gotten into SQL*Plus but I am definitely new to this utility so if I need to code something, please provide a simple instruction as to how to initiate new procedure creation and as to how to save, etc.
Thanks again for reading and offering any assistance.
Clutter
<b><u>Problem:</u></b>
Our current Oracle8 database schema has a table, e.g. "header", that has two related detail tables, e.g. "detail1" and "detail2". They are related in the following way:
<i>header.key --> detail1.header_key</i> and
<i>header.key --> detail2.header_key</i>
When developing reports (in Crystal Reports 8.5), the query brings back the following dataset:
<i>header.*, detail1.*, and detail2.*</i> but the details are never in the same row since they are exclusive resulting in two rows for every one header.
The biggest problem is when the requirement is to group by one "detail1" field and one "detail2" field. What happens is that the details are split out and then grouped with basically duplicates the header.
<b><u>Question:</u></b>
What I am looking to do is create a dynamic view (or should i be using a stored procedure) that would collect the data as one row (on the server side) and then I could use that view (or temp table) as my data source for the report.
I have gotten into SQL*Plus but I am definitely new to this utility so if I need to code something, please provide a simple instruction as to how to initiate new procedure creation and as to how to save, etc.
Thanks again for reading and offering any assistance.
Clutter