December 22, 2006, 11:52 AM
SteveHHold as db2 fieldname question
I have some db2 tables, an SQL query and I want to save the results in a db2
table. I'm using on table hold as myname format db2 and the table is saved.
That part works perfect; unfortunately I can not figure out how to save
field names, the only thing I get are the aliases E01... The alternative at
this point seems to be to script the table and do an insert. Hold as is
much simplier if I can get the field names working.
Thanks,
Steve
December 22, 2006, 12:34 PM
RichHHi Steve,
The way around this is to SET ASNAMES=ON and then use AS names, like
SUM SALES AS 'CASH'
Hope this helps.
Rich
December 22, 2006, 01:36 PM
SteveHRich,
I guess I was trying to take a little shortcut by doing a Print * .
Took your suggestion and it works great!
Thanks,
Steve