0

By default, when creating a view, for the Text of each column, if the column is a direct selection from a table/physical file then it will use the Text of that table/physical file's column. If it's not (e.g. a CASE statement), then it's blank.

How can I override it to set what I want for the view's columns' texts?

0

Simple: use an alias

SELECT ... CASE something WHEN 'somethingelse' ... END AS whatever, ...

The above will have the alias of WHATEVER. You can even get fancy and quote the alias:

... AS "Something Else"

which will have the alias of Something Else.

0

I don't know Db2 for i particularly but if what you are calling the Text for a column is actaully the LABEL, then try the LABEL command

https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/db2/rbafzlabelon.htm

or, if what you are calling the Text for a column is actaully the COMMENT, then try the COMMENT command

https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/db2/rbafzxcomnt.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.