Skip to Content
0
Former Member
Nov 10, 2016 at 11:04 AM

Impex Export collection data on many lines

349 Views

Hi all,

I've created an impex to export data from a Flexible Search. The impex should export the category code and the code of the products linked to this category.

The result of my impex returns all the products code in the same line, with a comma separator.

 CATEGORY_CODE;PRDCODE1,PRDCODE2,PRDCODE3,...

Whereras I'd like to get the following result :

 CATEGORY_CODE;PRDCODE1
 CATEGORY_CODE;PRDCODE2
 CATEGORY_CODE;PRDCODE3
 ...

My impex :

insert_update Category;code;products(code) "#% impex.exportItems( ""SELECT DISTINCT {CT:pk} FROM {Product as P}, {CatalogVersion as CV}, {Catalog as C}, {CategoryProductRelation as CPR}, {Category as CT} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='$catalog' AND {CV:version}='$catalogVersion' AND {CPR:target}={P:PK} AND {CPR.source}={CT:PK} AND {CT:code} = '$categoryCode' AND {CT:code} = 'XXXXX' "", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"

Can someone help me ?

Best regards

Sylvain