2017-04-05 54 views
0

我正嘗試使用.Net API向FileNet 5.2發送動態構建的查詢。我試圖查詢的文檔類在選擇列表中有三個屬性,它們具有無序列表的基數和類型字符串。當我送過來與DISTINCT關鍵字查詢,凡納返回此錯誤:如何在FileNet P8中查詢包含Unordered List屬性的不同文檔?

Can't select property with "distinct": RouteNumber.

這裏是獲取傳遞到F​​ileNet的一個例子SQL語句:

SELECT DISTINCT 
    td.DrawingNumber, 
    td.ProjectTitle, 
    td.WorkArea, 
    td.RouteNumber, 
    td.City, 
    td.County, 
    td.DrawingNumberAssignedYear, 
    td.Comment, 
    td.MajorVersionNumber, 
    td.IsCurrentVersion 
FROM TrafficDocument AS td WITH EXCLUDESUBCLASSES 
LEFT OUTER JOIN RoadwaySegment AS rwy WITH EXCLUDESUBCLASSES ON td.ID = rwy.ParentObjectID 
WHERE td.IsCurrentVersion = True 
    AND '104' IN RouteNumber 
ORDER BY td.DrawingNumber, td.TrafficPlanDiscipline 
OPTIONS (TIMELIMIT 180) 

我需要DISTINCT關鍵字,因爲這個加入文檔類RoadwaySegment導致重複,但在查詢中需要它,因爲它們的值也可以被濾除。

那麼我該如何實現查詢FileNet和檢索獨特結果的目標?

回答

0

RouteNumber的可訂購產權? DISTINCT只允許查詢。

DISTINCT restrictions

A DISTINCT query can be performed only when all of the SELECTed properties are orderable. For example, if property P1 is not orderable (Binary type, or String type with UsesLongColumn), the following query produces an error message:

SELECT DISTINCT P1 From Object1

相關問題