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!

compute field + column values concatenation

Status
Not open for further replies.

dydo01

Programmer
Feb 22, 2012
3
TN
Bonjour à tous,

I explain my problem with the following example :

my datawindow (dw_test) contains the following data, I want to have a compute field that the value is the concatenation of values of the column ​​TEST1

==> compute_test = value1.1 , value1.2 , value1.3 , value1.4

----------------------------
TEST1 | TEST2 |
------------|--------------|
value1.1 | value2.1 |
value1.2 | value2.2 |
value1.3 | value2.3 |
value1.4 | value2.4 |
-------------------------------

I don't want to loop over my dw to concatenate the values of the column "TEST1" (because my dw has more than 75000 row) ==> that's why I tried to optimise my code.

So I create a computed field named "compted_7" that have this expression :

if(getrow()>1, describe ( "evaluate ('compted_7'," + String(getrow()-1)+" )" ) +"," + String(test1), String(test1))

but the application crashed when I execute this code :

ls_result = dw_test.describe("evaluate('test1', "+ string(dw_test.rowcount()) + ")")

Please help me to write the right expression

Thanks in advance ;)
 
How are you retrieving the data? If it's via a SQL statement (or stored procedure), then you can use the COALESCE( ) function to build your concatenated string in a nice, clean, and fast way.
 
Hi,

Thanks for ur response, but I tried the "wm_concat" Oracle function but I'm getting this error "ORA-22813 : operand value exceeds system limits", because the size of string returned is too long (varchar2(4000) is the max in oracle) ==> so why I tried to do that in powerbuilder ;)

 
Hi,

In fact, my Query look like this :

select wm_concat(test1) from TEST;

wm_concat returns a VARCHAR2 (not a CLOB or LONG type), so I tried to do this concatenation in the datawindow.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top