I'm new to this, but how do I reference a single occurrence of a multi-value field in a TCL LIST statement?
Thanks,
CC
Carl,
If you select the table BY the MV field, it will "explode" the mv, normalizing the data on the fly.
For instance:
SELECT MY_TABLE BY MY_MV_FIELD WITH STATE=TX'
LIST MY_TABLE NAME CITY STATE ZIP MY_MV_FIELD
Let's say the select only grabs one record for the state of Texas, and MY_MV_FIELD contains 5 values. The list statement will print out 5 lines, with each of the single-valued fields being repeated to "flesh out" the data. Using the 'BY' keyword will also allow you to compare specific values in associated MV fields, e.g. effective and termination date history stacks.
Fair warning is given that this method can result in A LOT of records. I tend to nest multiple selects, with the earlier selects limiting based on single-valued fields and saving the BY MV_FIELD until the very end. This allows indexes to be used more efficiently and to keep a handle on the result set sizes.
msorrel@greyhound.com
What I'm trying to do is to display only a specific one of the MV entries instead of all of them, to make it more manageable.
Thanks,
Carl
Carl:
LIST FILE WITH MV_FIELD=VALUE" LIMIT MV_FIELD=VALUE"
Use in list, not select.
Thanks
That works if I know the value I want .. but it could be anything. From the list of all of the MV values, it looks like the one I want is always the first occurrence.
Thanks again,
Carl
Matt,
Actually that worked well, except for all of the extra non-MV lines which printed anyway.
Thanks,
Carl
build a new sysbolic dictionary item with the following formula
@ANS=@RECORD
or
@ANS={existing dictionary item name}
I use an admitted kludge to solve this problem:
The reports that need to do this are launched from an R/BASIC front-end that sets @USER0 to contain the values I need to output on a given report.
Then a Dictionary Symbolic extracts the desired value(s) from the MV array and outputs them. No blank lines, etc. and no need to do an exploded MV sort or LIMIT statement that doesn't always solve the extraneous value(s) problem due to blank lines, etc.
Don M.
Richard,
This looks like it is what I need to do, but I don't know how to use those things at TCL, i.e. LIST @ANS=@RECORD isn't acceptible. Is this R/BASIC code?
Ideally what I would like to do is to access these specific values in an export field name. In and Export ASCII record, is there some way to reference specific values?
Thanks,
Carl
If you want to do that, put it in curly braces:
LIST filename {@ANS=@RECORD}
you will need to build a new dictionary item with one of the formulas I had in my earlier post.
building dict items varies with the release of Arev you are running.
try dropping to Tcl and hitting F10 that may bring up the revelation main menu and from there you can build the new dictionary item
Rich
This appears to have worked GREAT for exporting. Thanks a ton, and what a responsive message board!
Carl
Antioch Company