Import Repricer in Navicat
Get the Broken Starter files from this JIRA ticket
- download
- cut/paste into a .txt doc
Use Navicat Import Wizard
- select .txt file
- import from _location of your choosing
- follow screen grabs below
Select delimited
- tab
- “
- Field Name Row: 1
- First Data Row: 2
- Delimiter: /
Target Table: tbl_catalog_tmp
Target Field: catalog_id
Delete all records in destination
Run query & export results to .xls
-
WITH VIEW_INVENTORY_COUNT AS (
-
SELECT
-
TBL_CATALOG.CATALOG_ID,
-
COUNT(TBL_INVENTORY.INVENTORY_ID) AS INVENTORY_ID_COUNT
-
FROM
-
TBL_CATALOG_TEMP INNER JOIN TBL_CATALOG ON TBL_CATALOG_TEMP.CATALOG_ID = TBL_CATALOG.CATALOG_ID
-
INNER JOIN TBL_PRODUCT ON TBL_CATALOG.PRODUCT_ID = TBL_PRODUCT.PRODUCT_ID
-
INNER JOIN TBL_INVENTORY ON TBL_INVENTORY.PRODUCT_ID = TBL_PRODUCT.PRODUCT_ID
-
INNER JOIN TBL_INVENTORY_STATUS_LOG ON TBL_INVENTORY_STATUS_LOG.INVENTORY_ID = TBL_INVENTORY.INVENTORY_ID
-
INNER JOIN TBL_PRODUCT_LOCATION ON TBL_PRODUCT_LOCATION.PRODUCT_LOCATION_ID = TBL_INVENTORY.PRODUCT_LOCATION_ID
-
WHERE
-
TBL_INVENTORY_STATUS_LOG.INVENTORY_STATUS_CODE = ‘AVAILABLE’
-
AND TBL_INVENTORY_STATUS_LOG.INVENTORY_STATUS_LOG_EXPDATE = ‘9999-12-31’
-
AND TBL_PRODUCT_LOCATION.PRODUCT_WAREHOUSE_ID = 12
-
GROUP BY
-
TBL_CATALOG.CATALOG_ID
-
)
-
SELECT
-
TBL_CATALOG.CATALOG_ID,
-
TBL_CATALOG.CATALOG_QTY,
-
TBL_PRODUCT.PRODUCT_ID,
-
TBL_PRODUCT.PRODUCT_UNIT_COST,
-
COALESCE(VIEW_INVENTORY_COUNT.INVENTORY_ID_COUNT,0) AS INVENTORY_ID_COUNT
-
FROM
-
TBL_CATALOG_TEMP INNER JOIN TBL_CATALOG ON TBL_CATALOG_TEMP.CATALOG_ID = TBL_CATALOG.CATALOG_ID
-
INNER JOIN TBL_PRODUCT ON TBL_CATALOG.PRODUCT_ID = TBL_PRODUCT.PRODUCT_ID
-
LEFT OUTER JOIN VIEW_INVENTORY_COUNT ON TBL_CATALOG_TEMP.CATALOG_ID = VIEW_INVENTORY_COUNT.CATALOG_ID
-
ORDER BY
-
TBL_CATALOG.CATALOG_ID