【问题标题】:Export data from Hybris HMC using IMPEX Import使用 IMPEX Import 从 Hybris HMC 导出数据
【发布时间】:2015-11-03 13:29:58
【问题描述】:

我正在尝试通过 Export Impex 脚本从多个表中导出数据,但无法为多个表定义标题。层次结构类似于: OrderTable>>OrderEntry>>UNIT>PRODUCTID

任何人都可以建议我如何实现这一目标。

"#% impex.setTargetFile( ""Orders.csv"" );" 

insert_update Order;code[unique=true];purchaseOrderNumber;sapOrderNumber;site(uid);date;subtotal;currency(isocode);soldto(uid);user(uid);salesdistrict(uid);

"#% impex.exportItems(""select {pk} from {order} where {currency} IN ({{select {pk} from {currency} where {isocode} IN ('NOK','DKK','EUR','SEK')}})"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"

【问题讨论】:

  • 能否请您发布您正在使用的 ImpEx 脚本?不看脚本很难判断哪里出错了
  • 嘿,我编写了从 HMC 导出数据的脚本,但它只能从一个表中导出数据。现在看impex文件我想加入两个或两个以上的表来导出数据。

标签: hybris impex


【解决方案1】:

您的查询抛出错误,因此您的导出失败。

尝试以下查询,

select {pk} from {Order as o}, {Currency as c} where {o.currency} = {c.pk} and {c.isocode} IN ('NOK','DKK','EUR','SEK')

这是另一个从 impex 导出的示例供您参考。

"#% impex.setTargetFile( ""Category.csv"" );"

insert_update Category;&Item;ambassadorDesc;catalog(id)[allownull=true];catalogVersion(catalog(id),version)[unique=true,allownull=true];code[unique=true,allownull=true];data_sheet(catalogVersion(catalog(id),version),code);defaultSku;description[lang=en];description[lang=en_GB];description[lang=en_US];detail(catalogVersion(catalog(id),version),code);logo(catalogVersion(catalog(id),version),code);name[lang=en];name[lang=en_GB];name[lang=en_US];normal(catalogVersion(catalog(id),version),code);order;others(catalogVersion(catalog(id),version),code);picture(catalogVersion(catalog(id),version),code);stockLevelThreshold;thumbnail(catalogVersion(catalog(id),version),code);thumbnails(catalogVersion(catalog(id),version),code)

"#% impex.exportItems( ""Select {cat.pk} from {Category as cat join Catalog as c on {cat.catalog}={c.PK}} where {c.id}='masterProductCatalog'"" , Collections.EMPTY_MAP, Collections.singletonList (Item.class) , true, true, -1, -1 );"

【讨论】:

    猜你喜欢
    • 2017-05-06
    • 1970-01-01
    • 2021-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多