Dynamically built selection sets
Nancy Palmquist
nlp at vss3.com
Wed Jul 7 07:31:40 PDT 2004
Ray Scheel wrote:
>
> The mention of languishing bug reports and another project I'm working on
> jogged my memory about my recent but unacknowledged bug report about the
> incompatibility with @pw- at pz with index scan in selection sets (at least
> under Linux). I've sent another query to fpsupport about the status of that
> report, but in the meantime I am wondering about how to create a more
> effective workaround that would build a selection set that would be
> compatible with the index scan feature using information entered/passed into
> the calling shell script, presuming a working sel.* table can be built by a
> *nix script.
>
> This is what at least works when index scan is on and there is an index
> built on fields 3 and 4, as it bypasses whatever triggers index scan and
> steps through all records to do the comparison:
> ::::::::::::::
> my_table/sel.works
> ::::::::::::::
> :@px:eqf:4
> :@py:eqf:3
>
> where this does not work (does not select anything) on the same values
> passed:
> ::::::::::::::
> my_table/sel.dontwork
> ::::::::::::::
> :3:eqf:@py
> :4:eqf:@px
>
> I was wondering what it would take in a *nix shell or PHP script to manually
> build a selection table using the passed/entered values such that a file
> would be created like the following I could then use as a -s in a call to
> rreport and immediately delete:
>
> ::::::::::::::
> my_table/sel.temp_rand#
> ::::::::::::::
> :3:eqf:[contents of @py]
> :4:eqf:[contents of @px]
>
> Actually, I'm hoping someone already has such a beast they would share that
> would be a better (functionally / faster for the end user) workaround that
> bypassing index scan on 500K+ record files where index scan on a manually
> built file finishes selections in a flash while the dynamic method takes
> several minutes.
>
> Ray
>
> Ray Scheel ray.scheel at wsdtx.org
> Windham School District Computer Services
> Programmer 936-291-5206
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
Ray,
The selection file is ASCII and I have seen many programmers collect the
data it requires with processing and create a sel.table and then use it
to run a report.
What you are suggesting is easy to do.
I think I would have two processes like this:
dreport filename -fp asksel -s none
Make a process called asksel, get the data you need and write the
selection table. You can use any file if you put the logic in the @done
part of the process table and use a selection table that does not pick
any records.
Then run the report you really want using the selection table created:
dreport filename -f report -s newselection
That would do it.
Be careful in the asksel to start the table with a line that has the END
command then the second line should be @DONE and do what you need.
Nancy
--
Nancy Palmquist
Virtual Software Systems
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list