cancel
Showing results for 
Search instead for 
Did you mean: 

Flexible Query in Impex Export

Former Member
0 Kudos

I need to export certain product data using Impex Export in Hybris (4.7.9). I am using the below script:

insert_update Product; catalogVersion(catalog(id),version)[unique=true]; code[unique=true];

"#% impex.exportItems(""SELECT {P:pk} FROM {Product as P}, {CatalogVersion as CV}, {Catalog as C} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='master' AND {CV:version}='Staged' AND {P:code} like 'ALB%'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"

But I am getting the following error when I use the flexible search query in the Impex Export script:

No valid line type found for {0="#% impex.exportItems(""SELECT {P:pk} FROM {Product as P}, {CatalogVersion as CV}, {Catalog as C} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='master' AND {CV:version}='Staged' AND {P:code} like 'ALB%'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 ), 1="}

Please let me know if anyone has information how this can be resolved.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hello,

I had a similar issue, and I found out my problem was simply a copy/paste issue. For obvious reasons, I build my FlexibleSearch and ImpEx statement in a notepad++ editor, and the copy/paste included a new unprinted character in front of the ImpEx statement.

Recreating the query from a blank file solved that problem. Hope it helps!

Former Member
0 Kudos

I had also tried impex.exportItemsFlexibleSearch, but it throws same error. Please let me know if you have any particular information regarding the cause of this error.

Former Member
0 Kudos

I am getting same error

Former Member
0 Kudos

sorry i had tried this above

Former Member
0 Kudos

No valid line type found for {0="#% impex.exportItems#% impex.exportItemsFlexibleSearch (""SELECT {P:pk} FROM {Product as P}, {CatalogVersion as CV}, {Catalog as C} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='master' AND {CV:version}='Staged' AND {P:code} like 'ALB%'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 ), 1="}

Former Member
0 Kudos

Hi Lokesh , i am getting same error after trying this :

No valid line type found for {0="#% impex.exportItems(""SELECT {P:pk} FROM {Product as P}, {CatalogVersion as CV}, {Catalog as C} WHERE {P:catalogversion}={CV:PK} AND {CV:catalog}={C:PK} AND {C:id}='master' AND {CV:version}='Staged' AND {P:code} like 'ALB%'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 ), 1="}

Former Member
0 Kudos

Hi Phani,

try using #% impex.exportItemsFlexibleSearch instead #% impex.exportItems... it should work