Does the Sort order in Views affect the result set?
I have two dataviews, linked on two fields (BRANCH_ID and CUSTOMER_ID). The
first dataview is sourced from three tables, and the second from an Oracle
View. I'm using RB 6.03 on Oracle 8.1.7. {End User Report Designer through
ClientDatasets/Datasnap}
Now since the second dataview is a detail of the first, when fetching the
records the SQL generated for the second dataview contains the first
dataviews sort fields etc. This SQL which I trap using an SQL Monitor, when
run using a different tool, returns a result set. Unfortunately for one
particular master record, although the detail SQL returns records it is not
displayed in the report. The problem seems to be the sort order. If I change
the master's sort order or the detail's sort order this detail record
appears on the report. I don't understand why sort orders would make a
difference in whether a record appears or not - but is there a relation, and
if so is there anything I can do to change that? [Unfortunately I need the
sort order to be a particular order specified, so I can't change that]
I can generate a test case, though what I have now is quite complicated to
post.
TIA,
--
Deepak Shenoy
Agni Software
http://www.agnisoft.com
first dataview is sourced from three tables, and the second from an Oracle
View. I'm using RB 6.03 on Oracle 8.1.7. {End User Report Designer through
ClientDatasets/Datasnap}
Now since the second dataview is a detail of the first, when fetching the
records the SQL generated for the second dataview contains the first
dataviews sort fields etc. This SQL which I trap using an SQL Monitor, when
run using a different tool, returns a result set. Unfortunately for one
particular master record, although the detail SQL returns records it is not
displayed in the report. The problem seems to be the sort order. If I change
the master's sort order or the detail's sort order this detail record
appears on the report. I don't understand why sort orders would make a
difference in whether a record appears or not - but is there a relation, and
if so is there anything I can do to change that? [Unfortunately I need the
sort order to be a particular order specified, so I can't change that]
I can generate a test case, though what I have now is quite complicated to
post.
TIA,
--
Deepak Shenoy
Agni Software
http://www.agnisoft.com
This discussion has been closed.
Comments
The detail SQL we generate should include the key linking field and all
ORDER BY's which are contained in the master query. You can Ctrl-click
over a detail dataview to see the linking SQL which is generated to the
database server. Have you teseted with RB 7.01? Try that first to see if
the problem goes away. You can download a trial edition from the website to
test the SQL generation without having to pay the RB7 upgrade price to test
RB 7.01. There have been a few tweaks to the SQL linking since the release
of RB 6.03.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
to
test
release
Cool, thanks for that Jim. I've been wondering why this particular SQL
generates results in Oracle Monitor, but does not show up in the report.
Will try to check with 7.01 to see if it goes away...
Thanks,
--
Deepak Shenoy
Agni Software
http://www.agnisoft.com