Toad World® Forums

Script to retrieve all entity and attribute descriptions in an LER model.


#1

Hi,

Could you help me with a script that retrieves the descriptions from the entities and attributes in a specific workspace?


#2

Hello,

Yes, of course, we’d be happy to help.
Just to be sure: LER model - you want to display the entity and attribute descriptions on the Workspace you select (make active).
Similar script that is available for PER model in Macros menu | Selected Objects | Display… on WS.

Is that right? Please confirm.
If we’ve misunderstood, please write us more details.

Thanks.

Regards,

Vladka


#3

To be more specific…

I have an LER model with a workspace for each logical subject area. I need to extract only the names and descriptions from a logical subject area (the currently active one) and just list them out for use in a word document / spreadsheet.

The following format would be incredibly helpful.

[entity record] ENTITY_NAME,DESCRIPTION
[attribute record]ATTRIBUTE_NAME,DESCRIPTION (in column order)

Hope that helps.


#4

HI,

can you send us a sample Word document to modeling@quest.com or attach it here? Please list two entities with two attributes in each entity. I’d like to know if you want to put some separator below each entity or not etc.

For this example, data is readable. But if we use real names for objects, I feel you may get lost in a mix of entity/attribute records.

Ent1, DescEnt1
Att1, DesAtt1
Att2, DesAtt2
Ent2, DescEnt2
Att1, DesAtt1
Att2, DesAtt2

Regards,

Vaclav


#5

Hi Vaclav

I have emailed a word version as requested

Thanksfor your help with this.


#6

Hello,

Please find attached the package that Vaclav created for you.

It contains macro “Generate CSV File” available in Macros menu in your logical model.
The macro creates a list of entity and attribute descriptions of all entities on the currently active Workspace OR of entities you selected on the Workspace. The output is in a CSV file.

How to use the package:

  1. Copy the .txg file to the location where you store user packages. Default location:
    C:\Documents and Settings\user\My Documents\Toad Data Modeler\Installation name\Packages{DCB5CB9B-CF65-4350-86B5-285D246FC5AC}
  2. Run TDM.

The macro is also available at:
http://modeling.inside.quest.com/entry.jspa?externalID=4060&categoryID=34

If you have any questions or remarks, please write us back. Thanks.

Regards,

Vladka + Vaclav Message was edited by: vladka

Message was edited by: vladka


#7

Oops. I’ve forgotten to attach the package.
Anyway, Vaclav will make few changes based on your reply.

I’ll post a new one in few minutes.

Vl.


#8

Hello David,

Here’s the new package for you.
The package contains macro “Generate CSV File” available in Macros menu in your logical model.
The macro creates a list of entity and attribute descriptions of all entities on the currently active Workspace OR of entities you selected on the Workspace.
While you select the macro, you can define your own marks to separate items and quotation marks.
The ouput is in a CSV file in the format you requested.

Steps to use the package:

  1. Copy the .txg file to the location where you store user packages. Default location:
    C:\Documents and Settings\user\My Documents\Toad Data Modeler\Installation name\Packages{DCB5CB9B-CF65-4350-86B5-285D246FC5AC}
  2. Run TDM.

It is also available at:
http://modeling.inside.quest.com/entry.jspa?externalID=4060&categoryID=34

If you have any questions, please write us back. Thanks.

Regards,

Vladka + Vaclav
GenerateCsvLogicalModel.zip (2 KB)


#9

Fantastic. Thank you very much


#10

We have downloaded the macro and have attempted to run it. We get an error on line 11, column 3. Property or method not supported. here is a copy of the statement.

form = System.CreateForm(‘Form’,‘Generate CSV’,250, 200);


#11

Hello Robert,

I’ve checked it in TDM 3.5.10 and it works fine for me.
Please write me:

  • your TDM version

  • what marks you define as a separator and quotation

  • if you run the macro on the active WS or only on few selected tables on the WS

  • if you can, please send us your model to modeling@quest.com.

Thanks for now.

Regards,

Vladka

Message was edited by: vladka - added note on model


#12

Thanks for the reply. I am using 3.4.16.7. I can upgrade so I can check that. I did not get to the point of specifying any seperators or anything. The dialog box never comes up. I am running Windows XP service pack 3 if that makes any difference.
test logical.txl (16.5 KB)


#13

Hello Robert,

Yes, please upgrade to v. 3.5. V. 3.4 didn’t support macros the way they are supported now in the new version.
It should work fine then.

In case of any trouble, please do not hesitate to write us back.

Thanks.

Regards,

Vladka + TDM Team


#14

Just to add the download info:
You can download Toad Data Modeler 3.5.10 from:
http://www.quest.com/common/registration.aspx?RequestDefID=10037
or via the Quest support website:
https://support.quest.com/
(section Downloads & Updates for Toad Data Modeler)

Regards,

Vladka