2017-01-09 114 views
-4
CREATE VIEW PEGADATA.LIST_WORKLIST_WB_ITEMS AS 
SELECT pxRefObjectInsName AS CASEID, pyAssignmentStatus AS STATUS, pxCreateDateTime AS CREATEDATETIME, pxAssignedOperatorID AS ASSIGNEDTO, pxGoalTime AS GOALTIME, pxDeadlineTime AS DEADLINETIME, pxGoalExecute AS GOALEXECUTETIME, pxDeadlineExecute AS DEADLINEEXECUTETIME, pxRefObjectClass AS REFERENCEDOBJCLASS, pxApplication AS APPLICATIONNAME, pyFlowType AS FLOWTYPE, pzInsKey AS INSTANCEHANDLEKEY, pxWorkGroup AS WORKGROUP, pxAssignedUserName AS ASSIGNEDUSERNAME 
FROM PEGADATA.pc_assign_worklist 
UNION 
SELECT pxRefObjectInsName AS CASEID, pyAssignmentStatus AS STATUS, pxCreateDateTime AS CREATEDATETIME, pxAssignedOperatorID AS ASSIGNEDTO, pxGoalTime AS GOALTIME, pxDeadlineTime AS DEADLINETIME, pxGoalExecute AS GOALEXECUTETIME, pxDeadlineExecute AS DEADLINEEXECUTETIME, pxRefObjectClass AS REFERENCEDOBJCLASS, pxApplication AS APPLICATIONNAME, pyFlowType AS FLOWTYPE, pzInsKey AS INSTANCEHANDLEKEY, pxWorkGroup AS WORKGROUP, DA.pyLabel AS ASSIGNEDUSERNAME 
FROM PEGADATA.pc_assign_workbasket, PEGADATA.pr_data_admin AS DA WHERE INNER JOIN PEGADATA.pc_assign_workbasket ON pxAssignedOperatorID = DA.pyWorkBasket; 

我得到錯誤:Oracle視圖創建錯誤ORA-00933

-ORA-00933: SQL command not properly ended

+1

不能使用'定義了一個表的別名時AS';但是WHERE INNER JOIN部分應該做的是什麼?回過頭再看看語法圖;並且不要將舊式語法(多個以逗號分隔的表格)與較新的連接語法混合使用,即使您將各個部分正確對待 - 最好只使用較新的「JOIN ... ON」樣式。 –

回答

0

你可能需要:

CREATE VIEW PEGADATA.LIST_WORKLIST_WB_ITEMS AS 
    SELECT pxRefObjectInsName AS CASEID, 
      pyAssignmentStatus AS STATUS, 
      pxCreateDateTime AS CREATEDATETIME, 
      pxAssignedOperatorID AS ASSIGNEDTO, 
      pxGoalTime AS GOALTIME, 
      pxDeadlineTime AS DEADLINETIME, 
      pxGoalExecute AS GOALEXECUTETIME, 
      pxDeadlineExecute AS DEADLINEEXECUTETIME, 
      pxRefObjectClass AS REFERENCEDOBJCLASS, 
      pxApplication AS APPLICATIONNAME, 
      pyFlowType AS FLOWTYPE, 
      pzInsKey AS INSTANCEHANDLEKEY, 
      pxWorkGroup AS WORKGROUP, 
      pxAssignedUserName AS ASSIGNEDUSERNAME 
     FROM PEGADATA.pc_assign_worklist 
    UNION 
    SELECT pxRefObjectInsName AS CASEID, 
      pyAssignmentStatus AS STATUS, 
      pxCreateDateTime AS CREATEDATETIME, 
      pxAssignedOperatorID AS ASSIGNEDTO, 
      pxGoalTime AS GOALTIME, 
      pxDeadlineTime AS DEADLINETIME, 
      pxGoalExecute AS GOALEXECUTETIME, 
      pxDeadlineExecute AS DEADLINEEXECUTETIME, 
      pxRefObjectClass AS REFERENCEDOBJCLASS, 
      pxApplication AS APPLICATIONNAME, 
      pyFlowType AS FLOWTYPE, 
      pzInsKey AS INSTANCEHANDLEKEY, 
      pxWorkGroup AS WORKGROUP, 
      DA.pyLabel AS ASSIGNEDUSERNAME 
     FROM PEGADATA.pr_data_admin DA 
     INNER JOIN 
      PEGADATA.pc_assign_workbasket ON pxAssignedOperatorID = DA.pyWorkBasket;