"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 06/07/2019
12:43:57 PM:
You've had a number of suggestions for alternative approaches. As Brad
says, Dynamic SQL is probably your best bet with minimal learning curve.
I keep seeing this but Dynamic SQL only gives you the first
feature in indirect addressing -- which is, simple retrieval. Please
correct me if I'm wrong, but it doesn't solve any of the other issues. For
example... What if all of the possible fields needing to be indirectly
referenced aren't the same data type? Further, even if the same data type
(e.g., decimal), what if the scale or precision varies?
In these cases, it doesn't help that Dynamic SQL will retrieve the
data because there is no dynamic way to store it in an appropriate data
area in RPG where it can be variably referenced according to its data
type, scale, and precision. Yes, you can always CAST to character format
but you still need some means of knowing what the data was so that you can
handle it appropriately. Yes, there are DESCRIPTORS. But the hole (and
the complexity) is just getting deeper and deeper.
Yes, using SELECT is more verbose, but it seems to me that at some
point you're still going to need SELECT so why not just start out that way
and avoid all the complexity?
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.