Toad World® Forums

Creating a Workspace based on a list


#1

I have a workspace with hundreds of tables in it. I want to be able to run a script that reads a list of tables that are then placed in their own workspace. I need to create multiple “subset” views of the larger collection of tables so it needs to be automated. I can’t just drag and drop. Any suggestions? I was able to do this using scripting in the past with E/R Studio.


#2

Hi,

I do not know how you created the list of tables, if you had to specify it somehow manually, I recommend you to use the Object Viewer with combination of custom packages. See:

http://modeling.inside.quest.com/entry.jspa?externalID=4846&categoryID=34

http://modeling.inside.quest.com/entry.jspa?externalID=4845&categoryID=34

It is also possible to right click workarea in your existing workspace and select the Workspace Members item. New dialog opens. If you select relationship, the related tables will be added there as well. (search of filter is planned for future releases).

I hope it helps,

Vaclav


#3

Hi,

I do not know how you created the list of tables, if you had to specify it somehow manually, I recommend you to use the Object Viewer with combination of custom packages. See:

http://modeling.inside.quest.com/entry.jspa?externalID=4846&categoryID=34

http://modeling.inside.quest.com/entry.jspa?externalID=4845&categoryID=34

It is also possible to right click workarea in your existing workspace and select the Workspace Members item. New dialog opens. If you select relationship, the related tables will be added there as well. (search of filter is planned for future releases).

I hope it helps,

Vaclav
newws1.png


#4

Hi,

I do not know how you created the list of tables, if you had to specify it somehow manually, I recommend you to use the Object Viewer with combination of custom packages. See:

http://modeling.inside.quest.com/entry.jspa?externalID=4846&categoryID=34

http://modeling.inside.quest.com/entry.jspa?externalID=4845&categoryID=34

It is also possible to right click workarea in your existing workspace and select the Workspace Members item. New dialog opens. If you select relationship, the related tables will be added there as well. (search of filter is planned for future releases).

I hope it helps,

Vaclav


#5

That technique doesn’t really work for me. I have hundreds of tables in my one workspace and I need to make several dozen workspaces based on list of tables that I’ve been given. Manually doing this would be too time consuming and error prone. I need a script that will iterate through the list and then add the table to the new workspace. Isn’t there a sample script that I can use for this? Thanks.


#6

I was able to accomplish what I need by stealing code from two scripts and cobbling them together. I took the AddEntitiesMacro dialog box code and used to that to generate my list of entities that I wanted copied to a new workspace. I took the copy function from CreateWorkspaceBySchemas and used that to copy the entities and placed that copy function inside of the loop that reads the list of names from the dialog box. Thanks! I wouldn’t have been able to do this from scratch without the examples. Once I saw the example code I was able to put this together. Toad Datamodeler rocks the database world!


#7

Hi,

I was going to prepare sample for you, but you were fast enough :slight_smile: Congratulations!

Have a great day,

Vaclav


#8

@Michael: Those scripts sound really interesting. Would you mind sharing them with us?