找出包含扩展了某扩展字段的所有表

比如,已知一个扩展类型是ProjCategoryId,下面的代码将为你找出所有使用过这个扩展类型的表。

 1 static void findTableWithProjCategoryId(Args _args)
 2 {
 3     xInfo xInfo = new xInfo();
 4  
 5     treeNode t = xInfo.rootNode().AOTfindChild("DataDictionary").AOTfindChild("Tables");
 6     treeNode childNode;
 7     treeNode fields;
 8     treenodeIterator it, itFld;
 9  
10     str properties;
11     str table;
12     str field;
13     str extendedDataType;
14     str searchType = "ProjCategoryId";
15     ;
16  
17     it        = t.AOTiterator();
18     childNode = it.next();
19     while (childNode)
20     {
21       Table = child.treeNodeName();
22       itFld = t.AOTfindChild(child.treeNodeName()).AOTfindChild("Fields").AOTiterator();
23  
24       fields = itFld.next();
25       while (fields)
26       {
27         field = fields.treeNodeName();
28         properties = fields.AOTgetProperties();
29         extendedDataType = findProperty(properties, "ExtendedDataType");
30  
31         if (extendedDataType == searchType)
32         {
33             info(strfmt("%1 / %2 - ExtendedDataType: %3", table, field, extendedDataType));
34         }
35             fields = itFld.next();
36       }
37       childNode= it.next();
38     }
39 }
posted @ 2012-08-30 16:10  Sprite.z  Views(260)  Comments(0Edit  收藏  举报