【问题标题】:Impex - How to update items which have a specific attribute with empty / null value?Impex - 如何更新具有空/空值的特定属性的项目?
【发布时间】:2020-12-17 12:50:21
【问题描述】:

我想更新没有productFixedUnitPrice 值的促销活动(productFixedUnitPrice 是一个集合)。我尝试了以下 Impex 脚本,但出现错误。

UPDATE CustomProductFixedPricePromotion[batchmode = true]; productFixedUnitPrice[unique = true]; priority;
;; 9999 ;

错误信息:

17.12.2020 13:17:58: ERROR: line 2 at main script: Flexiblesearch error: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )
17.12.2020 13:17:58: ERROR: line 2 at main script: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )
17.12.2020 13:17:58: ERROR: line 2 at main script: Exception 'missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )' in handling exception: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )
17.12.2020 13:17:58: ERROR: line 2 at main script: Exception 'missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )' in handling exception: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )
17.12.2020 13:17:58: ERROR: line 2 at main script: translated query was: SELECT  item_t0.PK  FROM promotion item_t0 WHERE ( item_t0.p_productfixedunitprice  = BINARY  ?) AND (item_t0.TypePkString=? )
17.12.2020 13:17:58: ERROR: line 2 at main script: translated query was: SELECT  item_t0.PK  FROM promotion item_t0 WHERE ( item_t0.p_productfixedunitprice  = BINARY  ?) AND (item_t0.TypePkString=? )
17.12.2020 13:17:58: ERROR: line 2 at main script: query was 'SELECT {pk} FROM {CustomProductFixedPricePromotion} WHERE {productFixedUnitPrice} = BINARY  ?productFixedUnitPrice1 '
17.12.2020 13:17:58: ERROR: line 2 at main script: query was 'SELECT {pk} FROM {CustomProductFixedPricePromotion} WHERE {productFixedUnitPrice} = BINARY  ?productFixedUnitPrice1 '
17.12.2020 13:17:58: ERROR: line 2 at main script: Flexiblesearch error: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )
17.12.2020 13:17:58: ERROR: line 2 at main script: missing values for [productFixedUnitPrice1] ( values provided {productfixedunitprice1=[], 11=8796119367762} )

除了空列,我还尝试了null<null><ignore> 值,但我也没有运气:

17.12.2020 13:23:57: ERROR: line 2 at main script: Exception 'pk has wrong format: '<null>':For input string: "<null>"' in handling exception: pk has wrong format: '<null>':For input string: "<null>"
17.12.2020 13:23:57: ERROR: line 2 at main script: Exception 'pk has wrong format: '<null>':For input string: "<null>"' in handling exception: pk has wrong format: '<null>':For input string: "<null>"
17.12.2020 13:23:57: ERROR: line 2 at main script: pk has wrong format: '<null>':For input string: "<null>"
17.12.2020 13:23:57: ERROR: line 2 at main script: pk has wrong format: '<null>':For input string: "<null>"

有趣的是,我们有多个 Hybris 环境,在其中一个环境中执行这个确切的脚本没有任何问题,但在其他环境中则没有。我们正在使用 Hybris 5.7。

你知道这里有什么问题吗?

【问题讨论】:

    标签: hybris impex


    【解决方案1】:

    我不确定您这样做的方式是否可行,但这是解决您问题的可靠方法:

     UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]
     UPDATE CustomProductFixedPricePromotion[batchmode = true]; productFixedUnitPrice[unique = true]; priority;[default=9999];
     #% impex.initDatabase("$config-db.url", "$config-db.username","$config-db.password","$config-db.driver");
     "#%
     impex.includeSQLData( 
     ""Put your generated sql here which you can get it from sql tab after running your flexible search.""
     );
     "
    

    用您实际的数据库配置更改$config-db..,并添加从灵活搜索生成的 SQL 查询,从而为您提供您想要更改的项目。

    欲了解更多信息:https://answers.sap.com/questions/12767995/flexible-search-in-impex-import.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多