[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Array Sort/Grouping Help



So you have

K1 -> S1 -> ID1, ID2 ...
          S2 -> ID1, ID2

K2 -> S1 -> ID1, ID2 ...
          S3 -> ID4, ID5...
...

Is it possible that you are approaching this the wrong way around?
Perhaps instead of build the IN lists you need a three-way join, and a
series of ON-BREAK procedures. This would allow you to 

Failing that, what if you did a load lookup? 

1. Create a view of the unique IDs--in Oracle terms this might be
CREATE OR REPLACE VIEW unique_b_ids
AS
SELECT id, rownum as rn
FROM (SELECT id from b order by id);

2. Code your load-lookup
load-lookup 
  name=b_ids
  rows=????
  table=unique_b_ids
  key=id
  return_value=rn

3. Then you can find out where in the array to stash your value (or add
it)
with 
lookup b_ids #id #idx
  

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users