将MS Access SQL转换为Oracle?

时间:2014-08-26 06:03:50

标签: sql oracle ms-access

我到目前为止:

MERGE INTO AIRMODEL_NETWORK_SUMMARY
USING (SELECT PRDCTN_RUN_ACTL_CASE_QTY, AIRMODEL_NETWORK_SUMMARY.rowid AS r 
    FROM AIRMODEL_NETWORK_SUMMARY
    INNER JOIN HISTORY_PRODUCTION
      ON (AIRMODEL_NETWORK_SUMMARY.FSCL_WK_IN_YR_NUM = HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM)
        AND (AIRMODEL_NETWORK_SUMMARY.FSCL_YR_NUM = HISTORY_PRODUCTION.FSCL_YR_NUM)
        AND (AIRMODEL_NETWORK_SUMMARY.LOC_ID = HISTORY_PRODUCTION.LOC_ID)
    INNER JOIN PERIOD_TO_PROCESS  
      ON (HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM = PERIOD_TO_PROCESS.FSCL_WK_IN_YR_NUM)
        AND (HISTORY_PRODUCTION.FSCL_YR_NUM = PERIOD_TO_PROCESS.FSCL_YR_NUM))
ON (AIRMODEL_NETWORK_SUMMARY.rowid = r) 
WHEN MATCHED THEN UPDATE 
SET CASES_PRODUCED = PRDCTN_RUN_ACTL_CASE_QTY;

但是没有我收到此错误:  ORA-30926:无法在源表中获得稳定的行集 30926. 00000 - "无法在源表中获得稳定的行集" *原因:由于dml较大,无法获得稳定的行集            活动或非确定性的where子句。 *操作:删除任何非确定性where子句并重新发出dml。

原始问题:

我认为最后有问题的查询...将ms-access sql转换为oracle

UPDATE PERIOD_TO_PROCESS INNER JOIN (AIRMODEL_NETWORK_SUMMARY INNER JOIN HISTORY_PRODUCTION ON
 (AIRMODEL_NETWORK_SUMMARY.FSCL_WK_IN_YR_NUM = HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM) AND 
 (AIRMODEL_NETWORK_SUMMARY.FSCL_YR_NUM = HISTORY_PRODUCTION.FSCL_YR_NUM) AND 
 (AIRMODEL_NETWORK_SUMMARY.LOC_ID = HISTORY_PRODUCTION.LOC_ID)) ON 
 (PERIOD_TO_PROCESS.FSCL_WK_IN_YR_NUM = HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM) AND 
 (PERIOD_TO_PROCESS.FSCL_YR_NUM = HISTORY_PRODUCTION.FSCL_YR_NUM) SET 
 AIRMODEL_NETWORK_SUMMARY.CASES_PRODUCED = PRDCTN_RUN_ACTL_CASE_QTY;

这是在访问中正确完成的吗?不知道,但它在访问错误时运行,并且无法计算如何

适用的表格列:

1. HISTORY_PRODUCTION
  - LOC_ID
  - FSCL_YR_NUM
  - FSCL_WK_IN_YR_NUM
  - SKU_COUNT
  - PRDCTN_RUN_ACTL_CASE_QTY

2. AIRMODEL_NETWORK_SUMMARY
  - LOC_ID
  - COUNTOFINVEN_ID
  - FSCL_YR_NUM
  - FSCL_WK_IN_YR_NUM
  - STOCKING_LEVEL
  - TOTAL_PALLETS_RQD
  - BAY_CASES
  - BAY_FULL_PALLETS
  - BAY_ADJUSTED_USPD
  - BAY_CASEFLOW_SKU_COUNT
  - BAY_PICK_PALLETS_RQD
  - BAY_PICK_FLOOR_POSITIONS
  - BULK_CASES
  - BULK_FULL_PALLETS
  - BULK_ADJUSTED_USPD
  - BULK_CASEFLOW_SKU_COUNT
  - BULK_PICK_PALLETS_RQD
  - BULK_PICK_FLOOR_POSITIONS
  - COMBINED_CASES
  - COMBINED_FULL_PALLETS
  - COMBINED_ADJUSTED_USPD
  - COMBINED_CASEFLOW_SKU_COUNT
  - COMBINED_PICK_PALLETS_RQD
  - COMBINED_PICK_FLOOR_POSITIONS
  - COMBINED_PALLET_RESERVE_RQD
  - SEPARATE_PALLET_RESERVE_RQD
  - SEPARATE_AISLES_REQUIRED
  - SEPARATE_BAYS_PER_AISLE
  - SEPARATE_PICK_SQFT
  - SEPARATE_RESERVE_SQFT
  - SEPARATE_CASEFLOW_SQFT
  - COMBINED_AISLES_REQUIRED
  - COMBINED_BAYS_PER_AISLE
  - COMBINED_PICK_SQFT
  - COMBINED_RESERVE_SQFT
  - COMBINED_CASEFLOW_SQFT
  - WEEKLY_LAYER_CASE_COUNT
  - DOCK_SQFT_COMBINED
  - DOCK_SQFT_SEPARATE
  - COMBINED_WHSE_DEPTH
  - COMBINED_WHSE_WIDTH
  - SEPARATE_WHSE_DEPTH
  - SEPARATE_WHSE_WIDTH
  - COMBINED_WHSE_SQFT
  - SEPARATE_WHSE_SQFT
  - RETURNS_SQFT
  - OVERTIME_HOURS
  - BREAK_QTY
  - SHRINK_QTY
  - OUT_OF_STOCK_QTY
  - CASES_SHIPPED
  - CASES_RCVD
  - CASES_PRODUCED
  - BREAK_COST
  - SHRINK_COST

3. PERIOD_TO_PROCESS
  - FSCL_YR_NUM
  - FSCL_WK_IN_YR_NUM

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用更新声明?接近的事情:

UPDATE
(
    SELECT 
        HISTORY_PRODUCTION.PRDCTN_RUN_ACTL_CASE_QTY
        ,AIRMODEL_NETWORK_SUMMARY.CASES_PRODUCED
    FROM 
        AIRMODEL_NETWORK_SUMMARY
            INNER JOIN 
        HISTORY_PRODUCTION
            ON AIRMODEL_NETWORK_SUMMARY.FSCL_WK_IN_YR_NUM = HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM
                AND AIRMODEL_NETWORK_SUMMARY.FSCL_YR_NUM = HISTORY_PRODUCTION.FSCL_YR_NUM
                AND AIRMODEL_NETWORK_SUMMARY.LOC_ID = HISTORY_PRODUCTION.LOC_ID
            INNER JOIN 
        PERIOD_TO_PROCESS  
            ON (HISTORY_PRODUCTION.FSCL_WK_IN_YR_NUM = PERIOD_TO_PROCESS.FSCL_WK_IN_YR_NUM)
                AND (HISTORY_PRODUCTION.FSCL_YR_NUM = PERIOD_TO_PROCESS.FSCL_YR_NUM)
)
SET AIRMODEL_NETWORK_SUMMARY.CASES_PRODUCED = HISTORY_PRODUCTION.PRDCTN_RUN_ACTL_CASE_QTY;