2016-07-28 32 views
0

在以前版本的Progress數據庫(9.X,10.X)中,以下查詢可以正常工作以查找表的主索引。查詢查找進度表的主索引(openegde V11.6)

select "_index-name" 
    from PUB."_index" in, PUB."_file" fi 
    where fi."_file-name"='tableName' 
    and in."rowid" = 
    (select"_file"."_prime-index" 
    from PUB."_file" fs 
    where fs."_file-name"='tableName'); 

現在ROWID已經在進步v11.6刪除,是否有任何SQL查詢通過ojdbc獲取進度數據庫表的主索引?

+2

也許您的表沒有主索引? –

回答

4

這也適用於11.6。請參閱以下查詢:

select "_index-name" from PUB."_index" idx, PUB."_file" fi where fi."_file-name"='Customer' and idx.rowid =(select"_file"."_prime-index" from PUB."_file" fs where fs."_file-name"='Customer'); 

_Index-Name 
-------------------------------- 
CustNum 
+0

謝謝@奧斯汀。我改變了。「rowid」in.rowid,它工作正常。 – Vel

+0

隨着在OpenEdge 11.4中執行表分區: http://knowledgebase.progress.com/articles/Article/P58968 如何更改上述查詢以獲取分區詳細信息以與ROWID進行比較? – Vel