I suppose the way to do this is to create the output table with the fields
specified in the SELECT, then submit to batch a RUNSQLSTM with the same
query, but prefaced with a "INSERT INTO xxxxxxxxxx (" It seems to me that
this would give the same results. Any disagreement there?
No disagreement. I did just that on Friday, and it worked well.
But what a PITA! First, I have to manually create the output table, then I
have to put the query in a source member for the RUNSQLSTM, and then submit
the RUNSQLSTM. There's gotta be an easier way.
I usually use Helpsystems' SEQUEL, but I'm increasingly finding need for
SQL features that aren't supported by SEQUEL. A couple of examples are
Common Table Expressions (and by extension recursive queries) and User
Defined Functions. Pure SQL also provides much more flexibility in join
types and join conditions.
In short: I'd love to hear alternative suggestions too!