
Oracle Selection Issue
#1
Posted 16 December 2011 - 02:43 PM
We are running version 6.2.35 on Linux and Oracle 10.2.0.5
#2
Posted 16 December 2011 - 09:37 PM
using the id from the master table as the primary key and the id from the detail as secondary. We then changed the report to do a sel-only on the primary key...the report no longer selects any data from the detail table.
I may be misinterpreting what you wrote here, but it sounds like you have a table, let's say an ORDERs table, where you have the ORDER_HDR and ORDER_DTL files you'd like to report from. You state that you're taking the ID key from the ORDER_HDR and using that as the primary key and then you're taking the ID key from the ORDER_DTL to use as the secondary key. If that's the case, then that's your problem. In ProIV, if you don't provide all the keys for a file you can't unlock the record to peek inside to see the details. The ORDER_DTL files will have more keys than just the ID key. To verify this, place a UMSG in the After Read Error logic to see if you can't get in.
HTH,
AK
#3
Posted 19 December 2011 - 12:39 PM
#4
Posted 21 December 2011 - 09:34 AM
Reports in Pro-IV are not my main area of expertise - but I've wrote a lot of them
In your report - if you rem out the sel-only in LS of ORDER_DTL does the report execute and return the all detail lines from the DTL table - place UMSG in the After REad of the DTL. ?
Assumin the report is to print 1 order only, I would typically code it as
LS1 (Assuming you are reading the HDR in this LS)
defined as ONE-TIME = 'Y'
LS1 - Default LGC
ORDER_HDR_ID = some value passed into the report function
LS2 (Assuming you are reading the DTL in this LS)
defined as ONE-TIME = 'N'
LS2 - Default LGC
* ORDER_HDR_ID this value inherited from LS1
ORDER_HDR_LINE = ''
SEL-ONLY( ORDER_HDR_ID )
The FLDs of LS1 should encompass the fields of LS2
If you post attachements/prints of your functions and the 2 Filedefs then I'm sure one of the many contributors to this forum will help you out.
Hope this helps
Rgds
George
#9
Posted 02 February 2012 - 04:34 PM
We have 2 tables with a master/detail relationship. We are using numeric ids as the primary keys to both tables. A nested report we wrote accessing both tables and using an SQL select works fine.
Then for comparison purposes we created a view of the detail table and defined it to PROIV using the id from the master table as the primary key and the id from the detail as secondary. We then changed the report to do a sel-only on the primary key...the report no longer selects any data from the detail table.
For comparison purposes, you first created a view in Oralce to see if you could and THEN after defining it in ProIV, tried to use it using the ID from the master table as the primary key and the ID from the detail as the secondary... Did you ever grant ProIV privileges to access the view?
AK
#13
Posted 07 February 2012 - 05:38 PM
A nested report we wrote accessing both tables and using an SQL select works fine. Then for comparison purposes we created a view of the detail table and defined it to PROIV using the id from the master table as the primary key and the id from the detail as secondary. We then changed the report to do a sel-only on the primary key...the report no longer selects any data from the detail table.
Tom,
From your posting of the code, for your report, it seems straightforward enough, and I'm surprised on why it's not working. But, I'm more perplexed on what you are attempting to do with Line 002 in Logic 1.
You wrote: "We then changed the report to do a sel-only on the primary key...the report no longer selects any data from the detail table."
You are attempting to set the secondary key to TBLLOCATION2, using the line LOC_ID = 0, but then only do a SEL-ONLY on the primary key...Why? Could there be a bug in VIP that is applying line 002, even though you are doing a SEL-ONLY on the primary key? Perhaps there are no records in TBLLOCATION2 with a LOC_ID = 0 and perhaps this is why the report no longer selects any data from the detail table.
Just throwing thoughts out...
AK
#14
Posted 07 February 2012 - 06:32 PM
I appreciate any and all thoughts on this, please keep them coming. That code is pretty standard for us since at one point if there was any 'leftover' data in a key beyond the selection key it would limit the data to only what was beyond that data....in essence doing a start from whatever was in that field. I'm not sure if that's no longer the case, but we've always 'cleared' data in subsequent key fields when doing a sel-only. I did try removing that line and ended up with the same results, - nothing selected.
Cheers,
Tom
#15
Posted 14 February 2012 - 02:11 PM
Also you could detail-trace the same thing from the Oracle side and see what actual data is being used (Oracle 10046 trace).
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users