Toad World® Forums

Can someone help me with a macro to set database space

I have reverse engineered one of our existing datbases and made a change. But now I have a validation error as the database space has not defaulted to system. Is there a way I can do this without editing every entity.

Thanks

Terry

Hi Terry,

If I understand you have a set of entities, that have assigned “DatabaseSpace1” and you want assign to all all entities which have “DatabaseSpace1” another “Database space”.

I can write to you this macro, but please I need to know what database are you use and what TDM version. I see that “database space” is in SAP Anywhere and Sybase IQ.

Daril

SQL Anywhere and Data Modeller 6.2

Oh and what I want to do is replace the DBSpace which hasn’t been assigned from a reverse engineered database. I want to set it to “system”

Hi Terry,

I created for you custom package, you can import it from "Main Menu - Customization - Import Custom Package" (Expert Mode must be switch on, you can switch on in Main Menu - Settings- Option - General).

Now when you have active Anywhere Model go to Main Menu - Macros. There should be new item "Assign Database Space".

DSMenu.png

You can run it, you get simply dialog, where you need to select destination Database Space (must be present in model) and click to Execute. For all entities in model will be assigned selected Database Space.

DS.png

If you wan modify this macro, you can open "Package Explorer" from "Main Menu - Expert Mode - Customization - Package Explorer". In toolbar of Package Explorer Hide System Packages and you will see only few packages. One oft them will be "DatabaseSpaceTools", open its branch and under Macros node is only one macro. You can modify it by popup menu "Edit Source Code" or "Properties".

I tested it on Anywhere 17, but it should works on Anywhere 11 too.

Daril
DatabaseSpaceTools.zip (1.73 KB)

Thanks Daril

**Terry Hastings **:: Database Administrator
E: thastings@auto-it.com.au

This email may contain privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this email, you are hereby notified that any use, dissemination, distribution or reproduction of this email is prohibited. No liability is accepted for the accuracy or integrity of the information contained herein or for any delays, interruptions, errors or omissions however occurring.

From: Daril [mailto:bounce-Daril@toadworld.com]

Sent: Friday, 14 July 2017 4:14 PM

To: tdmscript@toadworld.com

Subject: [Filtered] RE: [Toad Data Modeler - Scripting & Customizations Discussion Forum] Can someone help me with a macro to set database space

RE: Can someone help me with a macro to set database space

Reply by Daril

Hi Terry,

I created for you custom package, you can import it from “Main Menu - Customization - Import Custom Package” (Expert Mode must be switch on, you can switch on in Main Menu - Settings- Option - General).

Now when you have active Anywhere Model go to Main Menu - Macros. There should be new item “Assign Database Space”.

You can run it, you get simply dialog, where you need to select destination Database Space (must be present in model) and click to Execute. For all entities in model will be assigned selected Database Space.

If you wan modify this macro, you can open “Package Explorer” from “Main Menu - Expert Mode - Customization - Package Explorer”. In toolbar of Package Explorer Hide System Packages and you will see only few packages. One oft them will be “DatabaseSpaceTools”, open its branch and under Macros node is only one macro. You can modify it by popup menu “Edit Source Code” or “Properties”.

I tested it on Anywhere 17, but it should works on Anywhere 11 too.

Daril

Attachments:

DatabaseSpaceTools.zip

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Modeler - Scripting & Customizations Forum
notifications altogether.

Toad Data Modeler - Scripting & Customizations Discussion Forum

Flag
this post as spam/abuse.