A simple way to concatenate or combine two or more attributes in an environment would be to use the update option of the attribute properties. For example, let's say the environment has two varchar attributes attr1 and attr2 and we want to combine then to be attr1-attr2 and store that information in a third attribute named combined_attributes. You can set the update type for the third attribute to be SELECT and for SQL Server , the SQL select statement should be
SELECT '$EDIT#attr1$' + '-' + '$EDIT#attr2$'.
and for Oracle, the statement should be
SELECT '$EDIT#attr1$' || '-' || '$EDIT#attr2$' FROM dual
In addition, you may want to check the button for updating combined_attributes to when specific attributes are updated and set these attributes to attr1 and attr2. The drawback to this is if attr1 or attr2 is blank, the ‘-‘ will always be displayed. If either field can potentially be blank, then a more sophisticated solution will need to be used such as a stored procedure or a DLL using the SDK. Also, make sure the length of the combined attribute is at least the maximum size of the two attributes you will be combining plus one for the dash. JP
One way of getting rid of '-' for SQL Server:
select case when len('$EDIT#attr1$') * len('$EDIT#attr2$') > 0 then '$EDIT#attr1$-$EDIT#attr2$'else '$EDIT#attr1$$EDIT#attr2$' end
and for Oracle:
select case when nvl(length(trim('$EDIT#attr1$')),0) * nvl(length(trim('$EDIT#attr2$')),0) > 0 then '$EDIT#attr1$-$EDIT#attr2$' else '$EDIT#attr1$$EDIT#attr2$' end from dual
This has helped me with a different Attribute SELECT Statement problem. THANK YOU, THANK YOU!!!