sql特定的类型代码无效,方法调用impex.exportitemsflexiblesearch错误

nhjlsmyf  于 2021-07-24  发布在  Java
关注(0)|答案(1)|浏览(320)

请求您的帮助,我不知道为什么我仍然会遇到这些错误:(

20.06.25 18:47:40:992   ERROR   line 3 at main script: Flexiblesearch error: type code 'StockLevel ' invalid
20.06.25 18:47:40:992   ERROR   line 3 at main script: query was 'SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}'
20.06.25 18:47:41:173   ERROR   line 3 at main script: error executing code line at 3 : Sourced file: inline evaluation of: ``impex.exportItemsFlexibleSearch("SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} . . . '' : Method Invocation impex.exportItemsFlexibleSearch

以下是我导出数据的提示:

INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}"");"

谢谢。:)

xpszyzbs

xpszyzbs1#

我试着在我的本地机器上运行你的脚本,它导出了数据。你有没有检查过 StockLevel 类型是否存在?它是basecommerce扩展的一部分。
另外,试试这个重构的impex。当没有结果时,它将工作:

INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} FROM {StockLevel AS sl JOIN Product AS p ON {p.code}={sl.productCode} JOIN ArticleApprovalStatus AS aas ON {aas.pk}={p.approvalStatus} JOIN CatalogVersion AS cv ON {cv.pk}={p.catalogVersion}} WHERE {cv.version}='online' AND {aas.code}='approved'"");"

相关问题