2016-07-28 34 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