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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining text object and column

Status
Not open for further replies.

paul102384

Programmer
Oct 5, 2007
30
Hi to all pb programmers:

I want ask if is it possible to combine a text object and a particular column in datawindow object?if it's possible can somebody tell me how to do this..

e.g..

text object named

- text_1
and the text value is : Name:

column named

- l_name
and the column value is: John


then upon combining this two objects the value becomes:

Name:John

tnx in advance.
 
Put it in a computed object... The value in the computed object would be: "Name: " + l_name
 
thanks thekl0wn, i appreciate your reply, but it happens that the value of text object named text_1 is not always "Name:" if that so is it possible to combine a text object and a particular column in datawindow object?
 
What is the source of text object value?

If it's hard coded in DW, you can combine it with database column using computed field, like thekl0wn said.

If you get it from database or as a retrieval argument, you can combine it with database column using computed field too, like thekl0wn said.

Is any other way to get this text value?

Tomek
 
How is the text's value decided? By the way the question was asked, I assumed it was static...

You can simply combine computed fields/columns of the same type... Let's say you have a column named col_1 and a computed object c_1, both are string-based, and a retrieval argument an_type which is an integer (variable to decide the text value).

c_1's expression is something like: CASE( an_type WHEN 1 THEN "Name: " WHEN 2 THEN "Address: " WHEN 3 THEN "DOB: " ELSE "Value: " )

Then, create another computed object with the expression: c_1 + col_1

When you do a dw.Retrieve( 1 ) you will get something like: "Name: Bob" for the computed object. You can do this in the SQL as well using the case statement as well (better local performance).
 
thanks guys, i really appreciated your replies..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top