Toad World® Forums

Excel import / export custom fields

In TDM 5.2.4.25 it is possible to export and import to EXCEL. Is it possible to add custom fields to the EXCEL export/import?

Hello Mary,

you can do this by customization scripts for Export and Import. I don’t know what you exactly need. So a little example: I want add information about Global Temporary Table in Entity (DB Oracle 10g). I have two choices:

a) Modify System Script - Need write to Installation directory (default Program Files)

b) Create New Script, that overrides system script

For simplicity I give example for point a.

  1. Turn on Expert Mode. You can find it in Settings-Options-General Tab

  2. Open Script Explorer(Expert Mode Menu or Toolbar)

  3. Open Script “CSAO Class Definitions\ExportImportManager”

  4. Now need unlock script for write. Please Right Click to script source code and choice Script Properties, than you see button Unlock package

  5. In script source code find “function GetDefinitionEntity” and modify deffinition array for physical model

First dimension is Property Name

Second Dimension is Caption

Third Boolean Dimension is write protection in Excel

function GetDefinitionEntity(Model)
{
var result = new Array();

if(Model.ModelDef.Name == “Logical model”) //LogicalModel else PhysicalModel
result = [[‘Id’,‘Caption’,‘Name’,‘Description’] , [‘Id’,‘Caption’,‘Name’,‘Description’] , [false,true,true,true] , [‘Entities’, ‘Entities’, 4004, true]];
else //propertyName //propertyCaption //isModified //caption //name //objType //Visible in GUI
{
var schDbOw = FindSchemaOrDbOrOwn();//Schema/Database/Owner
result = [[‘Id’,‘Caption’,‘Name’,schDbOw,‘Comments’,‘Notes’,‘BeforeScript’,‘AfterScript’,‘GlobalTemp’] ,
[‘Id’,‘Caption’,‘Name’,‘Schema’,‘Comments’,‘Notes’,‘Before Script’,‘After Script’,‘Global Temporary Table’] ,
[false,true,true,false,true,true,true,true,false] , [‘Entities’, ‘Entities’, 2002, true]];
}
return result;
}

Now you can save script a try export to excel.

If you have any other questions don’t hesitate contact us