Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Select field names

Status
Not open for further replies.

mrzepnic

Programmer
Dec 9, 2004
16
US
I have a sql statement that I need to either sub select or concat to create the select field. When I do this it returns the value of the concat ex.

Select concat('Hel','lo') from world

It would return Hello instead of the value for the column HELLO.

It does the same thing if I subselect from syscolumns

Select (select column_name from syscolumns) from world

Any ideas on how to do this interactively?

 
I don't think that it is possible within DB2 itself. The only solution is to build an appication which will determine the column name needed, and then build the SQL for submission.

The application could be a complex script in UNIX / AIX, or could be a procedure building dynamc SQL.
 
Brian,

Thanks that what I thought but, I wanted to be sure.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top