How to find all tables using a defined EDT?

2.2k Views Asked by At

How does one create a job which finds all tables containing a particular extended data type?

I found this JOB, but it gives me an error: https://fredshen.wordpress.com/2006/02/05/find-out-tables-containing-specific-edt/

2

There are 2 best solutions below

0
On BEST ANSWER

try this:

static void findEdtinTable(Args _args)
{
    treeNode childNode;
    treeNode fields;
    treenodeIterator it, itFld;

    str properties;
    str table;
    str field;
    str extendedDataType;
    str searchType = "PurchInternalInvoiceId";     // EDT
    int x;
    treeNode t  = TreeNode::findNode('\\Data Dictionary\\Tables');

    it = t.AOTiterator();
    childNode= it.next();
    while (childNode)
    {
      Table = childNode.treeNodeName();
      itFld = t.AOTfindChild(childNode.treeNodeName()).AOTfindChild("Fields").AOTiterator();

      fields = itFld.next();
      while (fields)
      {
        field = fields.treeNodeName();
        properties = fields.AOTgetProperties();
        extendedDataType = findProperty(properties, "ExtendedDataType");

        if (extendedDataType == searchType)
        {
          info(strfmt("%1 / %2 – ExtendedDataType: %3", table, field, extendedDataType));
        }
        fields = itFld.next();
      }
      childNode= it.next();
    }
}
0
On

Use the Cross Reference Tool.

It will show code uses as well.