Hi, I am not sure if this is the appropriate place for this request, however I have not figured out a better place to ask it.
I am New To Toad Data Modeler.
I have learned how to use the scripting Window very well via the examples that have been available to me to manipulate Data within the TDM MetaModel.
However, Jscript examples or vbscript examples I have found on the Web are not executable via the Scripting Window in TDM so I believe that it is a Customization of jscript or vbscript unless I am doing something wrong.
And the reason I am looking into examples is because I have been trying to see if via jscript or vbscript using the scripting window If I can redirect output to a file
What I mean is In the small jscript script below which lists the attributes of 2 entities, If I wanted to write output it to a file called as example “C:\toadoutput.txt” instead of the only thing currently I can do which is to output to the log buffer using the line Log.Information command.
Is that possible ?
Also, Is there a way within jscript or vbscript like in the example below to filter entities by there discovery within a workspace. Meaning, if I have Table_1 and Table_2 in my Model, and Table_1 is currently a EntityShortcut in a Workspace called “AnthonyWS” Is there a way to only find entities which are linked to the Workspace “AnthonyWS”
Any Assistance in this would be appreciated as I am looking to write some Custom Reports in which are Custom Enough to be best served via a Custom Script that I write.
function main()
{
var app = System.GetInterface(‘Application’);
var Model = app.Models.GetObject(0);
var e, a, Entity, Attribute;
for (e=0; e<2; e++) // iterate entities
{
Entity = Model.Entities.GetObject(e);
for (a=0; a<Entity.Attributes.Count; a++) // iterate attributes
{
Attribute = Entity.Attributes.GetObject(a);
Log.Information('Entity = ‘+Entity.Name+’ Attribute Name '+Attribute.Name);
}
}
}
Thanks